my question:
In the ' CSceneManager::drawAll() ----- SolidNodeList.sort()',
I found the heap sort function, compare one DefaultNodeEntry's TextureValue with another's , in fact, compare their SMaterialLayer::ITexture* .
In the other words, it compare two address.
Why? the address, ITexture*, can represent the SolidNode's distance to camera?
tanks.
SolidNodeList.sort()
Re: SolidNodeList.sort()
I wanna ask a question about sorting here.
Solid nodes are sorted by texture for less texture changes, but not sorted by material types.
So does texture changing have more overhead time than other opengl state changes?
(like glEnable / glDisable / glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE), ...)
Solid nodes are sorted by texture for less texture changes, but not sorted by material types.
So does texture changing have more overhead time than other opengl state changes?
(like glEnable / glDisable / glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE), ...)