Floating point texture question
-
terra0nova
- Posts: 3
- Joined: Mon Feb 22, 2010 6:16 pm
Floating point texture question
Quick question: why are floating point textures only supported for render target textures? I need it to upload precomputed scatter coefficients for a simple atmospheric scattering approximation. Is there a specific reason why this is not allowed? Right now, I am bypassing this by directly calling the opengl methods to upload and bind the texture, which works, but then I cannot use irrlicht with other renderers, so I would prefer if I could create the texture using the createImage functions, but I get an error that the format is only supported for render target textures.
-
terra0nova
- Posts: 3
- Joined: Mon Feb 22, 2010 6:16 pm
Ok, thanks for the reply. I guess I'll have to just use what I have then until floating point texture support is added to Irrlicht. It works with the OpenGL driver, although I'm a little worried about mixing plain OpenGL and irrlicht - since it keeps track of what the last material bound was, I have to use glPushAttrib and glPopAttrib so that it doesn't realize that the render state has changed, and I also have to make sure that nothing was set (like wireframe mode) that destroys the atmosphere rendering, causing a lot more state change overhead than needed.
Could I avoid this problem by writing a custom material class? Like, how is there a way I can add my own code when a material is bound and released (I don't see any such functions in SMaterial). Any tips on that would be nice.
EDIT: Nevermind, solved it myself. While it loads the texture and binds it via opengl, everything else is now working in Irrlicht
.
Could I avoid this problem by writing a custom material class? Like, how is there a way I can add my own code when a material is bound and released (I don't see any such functions in SMaterial). Any tips on that would be nice.
EDIT: Nevermind, solved it myself. While it loads the texture and binds it via opengl, everything else is now working in Irrlicht