Currently , in my code I am sorting my draw calls based on GL_BLEND, textures and vertex buffers ( in that order.) – this seems to be working pretty well.< ?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Now I have to somehow incorporate GL_LIGHTING into my sort order… I am wondering if, from a performance point of view , are glEnable(GL_LIGHTING)/glDisable(GL_LIGHTING) calls considered context switch “heavy” and should I even bother trying to group batches based on the GL_LIGHTING state – in other words, is calling glEnable(GL_LIGHTING) … glDisable(GL_LIGHTING) repeatedly, going to incur significant performance hit ?
The cost depends on the platform and whether vertex processing is performed in hardware (i.e. VGP alongside MBX, or SGX). What is the average number of Enable/Disable(GL_LIGHTING) and other light state changes per frame without sorting?
Having sorted my batches by blend/textures/geometry I have pretty much ordered them by their GL_LIGHTING property as well ( I have basically two basic sets of geometry – light mapped and using a single GL_LIGHT)
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.