Indeed, It appears we are using the gl_Fog.density to accomplish this. So we aren't turning off the FOG, but determining that it not doing anything by having no density.

David

On Nov 10, 2006, at 12:54 PM, Zach Deedler wrote:

Hi David,

I don't think there is a way to read the GL_FOG ON/OFF attribute from within
the shader?  I have the orange book, but it doesn't have any built-in
functions or uniforms for getting the state of GL_FOG ON/OFF.


Zach

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Guthrie
Sent: Friday, November 10, 2006 09:26
To: osg users
Subject: Re: [osg-users] glsl shader ON/OFF

Since you can read the GL_FOG parameters in the shader, why not just read
the attribute and don't calculate fog in the shader.  That's pretty
analogous to setting a uniform.

David

On Nov 9, 2006, at 6:13 PM, Robert Osfield wrote:

Hi Zach,

On 11/9/06, Zach Deedler <[EMAIL PROTECTED]> wrote:
Hello,

Easy question.

I have a fog shader, and I want to disable it sometimes.
stateSet->setMode(GL_FOG, osg::StateAttribute::OFF) in a shader?

Fixed function pipeline is sweet for many things... shaders well make
the above rather more awkward...

Whats optimal?
1) remove the program from the stateset? or
2) set the program mode to OFF? or
3) add a bool on/off uniform to the shader?
4) Attach a switch node to the state set?

Switching StateSet to use different programs, or using a uniform value
to switch the shader path on/off would be my favorite solutions.

Robert.
_______________________________________________
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/

_______________________________________________
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