OpenGL fragment programs don't have any information about what texture units are enabled or disabled. The closest you could come to it would be to use a set of osg::Uniform values to pass information into the shaders about what textures to read or not.
Personally I wouldn't rely on any texture read operation on units that haven't been assigned textures and enabled.
Robert.
I apologise in advance for this being somewhat off topic, but this was the best place I could think of for a quick answer.
Q. In an OpenGL fragment shader program, how do I find out which texture units are currently active?
The reason I ask this is that I am trying to add a procedural texture to part of my scene graph. Other built in functionality texture units may well also be active at this point.
Because the fragment shader replaces all the built in texture processing I need to know whether to apply these texture within the shader as well.
The fragment shader function texture2D seems to return vec4(0,0,0,0) when no texture is assigned, but this does not seem to be documented. So can I rely on it?
Roger
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
