Hi Roger,

Roger James wrote:
> 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?

If by active, you mean they're enabled for fixed-functionality texturing, then
no, there is not a built-in GLSL uniform to query the fixed-functionality enable
state of texture units.

> 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.

Your app will need to convey that information via uniforms.

> 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?

I would not, unless the Spec clearly defined that behavior.

Cheers
-- mew

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to