Floating point texture question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
terra0nova
Posts: 3
Joined: Mon Feb 22, 2010 6:16 pm

Floating point texture question

Post by terra0nova »

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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The image classes are not yet capable of suh formats, hence it's not possible all the way down.
terra0nova
Posts: 3
Joined: Mon Feb 22, 2010 6:16 pm

Post by terra0nova »

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 :) .
Post Reply