IDirect3DBaseTexture9::SetLOD is used for level-of-detail control of managed textures. This method returns 0 on nonmanaged textures.
IDirect3DBaseTexture9::SetLOD communicates to the Direct3D texture manager the most detailed mipmap in the chain that should be loaded into local video memory. For example, in a five-level mipmap chain, setting LODNew to 2 indicates that the texture manager should load only mipmap levels 2 through 4 into local video memory at any given time.
More specifically, if the texture was created with the dimensions of 256x256, setting the most detailed level to 0 indicates that 256 x 256 is the largest mipmap available, setting the most detailed level to 1 indicates that 128 x 128 is the largest mipmap available, and so on, up to the most detailed mip level (the smallest texture size) for the chain.
I would propose to add this to irrlicht (don't know equivalent for OpenGL), to the ITexture:
First question: What do you need this for? I alsways wondered why one would need it. But yes, I already saw this feature, it's also available for OpenGL, so it might go into the core library.
But, why into the texture and not into the material? This would allow for different mipmap depth for the same texture.
If you are using shaders (which i know you do) you can set the mipmap bias during the texture read, thats the qucik way if you dont want to modify irrlicht.
Btw do you just want to set LOD? or are you going to use this for memory conservation? i think the text says it also has some memory savings by not loading higher lods.
"Irrlicht is obese"
If you want modern rendering techniques learn how to make them or go to the engine next door =p
Your last line means still it's in the texture class, not in the material. But I guess it might be reasonable to require a diofferent LOD for other meshes. With LOD in the texture you would change the LOD for a texture in all meshes at once.
I agree with Hybrid. If there's any point in having this then it would be so you could set the LOD for different meshes or different uses of the texture, not for the single texture for all uses in the app as then what would the point be, you might as well just load the texture at that specified LOD instead and save on loading time and memory as you would never be using any of the higher LODs presumably.
What reason would you be using this for? Would you want to change the LOD of all uses of the texture at some point for some reason? Maybe when doing some multi-pass effects it might be useful to cut down the LOD if it wasn't required to be high quality and then you'd want to have it in the texture so you could just do it once. So maybe you could have it in both the texture and the material and the texture one overrides the material or something.
Just thought of one way you might want to use this is in a settings menu. You could allow the user to choose high, medium or low quality textures in order to speed up the game for them.
hybrid wrote:Your last line means still it's in the texture class, not in the material
Yeah, i realized that later during the day
so didnt have chance to edit post, lapse of concretation.
Put it (if you wish) anywhere you whant.
JP wrote:Just thought of one way you might want to use this is in a settings menu. You could allow the user to choose high, medium or low quality textures in order to speed up the game for them.
thats exacly what was i am trying to explain why i need it.
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
When i give further thought, i dont see how this can work as you
proposed as same texture is loaded only once i memory but can be used
by many different nodes..gui elements?
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
Even if you have two same meshes you might want to have the texture LOD different, e.g. because one is far away. But you can also have other occasions where textures are shared, e.g. buildings which have common roofs or things attached to the fronts. Plants are also a good example for texture reuse. You might want to have three levels of detail in your scene.