Hi,

I have a set of shaders, each of them having some
uniform parameters in common which reflect some global
state of the program. However, not all shaders have
all those uniform value, but my program just assigns (brute force)
all global parameters to all shaders via "setUniformParameter".
That works perfectly ok, but I get a lot of "Unknown parameter"
WARNING messages in my OpenSG log (which is correct). The
only thing is, it's quite annoying seeing those printfs in
every frame :). The problem seems to be that OpenGL
knows just after linking which uniform parameters are
actually available in the shader (see "glGetUniformLocationARB").
So I never see "false" as return values from setUniformParameter
during initialization and setup of OpenSG.

E.g. The code below never gets to the point to call
subUniformParameter, although I set arbitrary uniform
paramters.

UniformType tmp;
bool state = false;
if( shader->getUniformParameter( uniformName, tmp ) ){
    beginEditCP(shader, SHLChunk::ParametersFieldMask);
       state  = shader->setUniformParameter(uniformName, value);
    endEditCP(shader, SHLChunk::ParametersFieldMask);
    if( !state )
      shader->subUniformParameter(uniformName);
}


So what do you think could be done? Some convenience methods
in SHLChunk for validating a shader (passing in a window)?
I saw there's a "updateProgram" method that does something
similar.... Could that be public? Perhaps that'd be
a mess...

   Toni

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to