Hi Antonio,
Antonio Bleile wrote:
> 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);
> }
yes, because calling setUniformParameter with an parameter that was not
added to the SHLChunk yet, will just add it. You would get a return
value of false if you tried to add two parameters of different type, but
with the same name.
I think you are overestimating what OpenSG does when you add parameters,
it certainly does not parse the shader code to find the ones used in
there and then reject those that are not ;)
> 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...
If you are only interested in silencing the warning, we might add an
option that suppresses it. Removing it altogether is probably a bad idea
as is very helpful for finding typos in parameter names. Would that be
sufficient for your needs ?
Otherwise you'd have to track the parameters used in your shader
programs yourself. I would not be surprised if there is code available
on the net that can extract that information from the shader source.
Hope it helps,
Carsten
-------------------------------------------------------------------------
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