[osg-users] Centroid Varying Shader Variable

paul1492 at yahoo.com paul1492 at yahoo.com
Mon Jul 7 15:16:44 PDT 2008


>From Page 8 of the document:=====
The directive “
Version 1.10 of the language does not require shaders to include this directive, and shaders that#version directive will be treated as targeting version 1.10. The behavior of shaders
do not include a 
targeting version 1.10 will not be effected by any changes introduced in version 1.20.
=====
You would have thought that a 1.2 compiler would be able to compile all earlier version of the language but they decided to implement it such you must tell the compile your using 1.2 of the language. 
Also, about the CPP part of my question, I see the shader language supports many of these directives.. Is there any way to externally (i.e. in OSG) to set a "#define" variable?? For example, With the CPP, I use "cpp -DVariable=10 infile.txt outfile.txt". And then I'd do a:
    fragProgram->loadShaderSourceFromFile("outfile.txt");
Do I have to create a "#define Variable 10" string and prepend it to my shader code (which isn't easy if I use "loadShaderSourceFromFile()"). Is there some other way? Anybody use the shader's conditional compile directives?
Paul P.



----- Original Message ----
From: Gordon Tomlinson <gordon.tomlinson at sensor.com>
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Sent: Monday, July 7, 2008 5:34:18 PM
Subject: Re: [osg-users] Centroid Varying Shader Variable

And the answer was ?



-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of
paul1492 at yahoo.com
Sent: Monday, July 07, 2008 5:31 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Centroid Varying Shader Variable

Never mind.... I guess I found my answers here:
http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf

Paul P.

----- Original Message ----
From: "paul1492 at yahoo.com" <paul1492 at yahoo.com>
To: osg-users at lists.openscenegraph.org
Sent: Monday, July 7, 2008 3:19:12 PM
Subject: [osg-users] Centroid Varying Shader Variable

I'm attempting to define a "centroid varying variable":
<http://www.opengl.org/pipeline/article/vol003_6/>
Why do I need the "#version 120" line?
I send my shader programs through the C-Preprocessor (cpp) before giving
them to OSG and CPP doesn't like this line (clearly it thinks its a command
it should understand).. I assume this line is defining the Shader Version to
use (1.2). If I don't have this line, the shader compiler doesn't like the
"centroid" word.
Setting OSG_NOTIFY_LEVEL seems to report that glslLanguageVersion=1.2 even
when I don't use #version.
Is there some other way to tell the shader compiler/OSG that that the shader
is a 1.2 shader? While I'm at it, does the shader compiler natively support
any CPP directives (i.e. # commands).?
Paul P.


      
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



      
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
#version 120” is required in any shader that uses version 1.20 of the language. ... 


      



More information about the osg-users mailing list