Hi,

Designwise, it would seem your shader is too high in the scenegraph thus
affecting too many things.  Be selective; attach shaders lower near the leaf
nodes that actually should be shaded, so OSG will automatically activate during
state management.

GLSL does not automatically expose the glEnable() state for textures.  If you
want that, you'll need to declare a uniform to provide that info to the shader
as appropriate.

cheers
-- mew


Zach Deedler wrote:
> Hello all,
>  
> I'm getting waist deep in glsl shading.  I could use some basic help.
> 
> *PROBLEM*
> I am using a shader that calls color *= texture2D(diffuseTex,
> gl_TexCoord[0].xy); 
> This causes all models that don't have a texture to not be colored at
> all.  Since osgText::Text is not textured, the color of the text is not
> applied.  The result is shown below:
> 
> Note: The headlight beams show up emissive and colored because they are
> textured.  The "PT Cruiser" text does not show up emissive or yellow as
> it should.
>  
> *QUESTIONS*
> 1) Is there some way I can modify the shader to detect that it is not
> textured?
> 2) Is the only solution to traverse the scene graph and turn off the
> shader for text?
> 3) Is this where I should use nodeMask?
>  
> Thanks a lot.
> 
> Zach
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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/

Reply via email to