Scrive Carsten Neumann <[EMAIL PROTECTED]>:
> 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 ;)
Yes I got such code somewhere, just wanted to make sure that OpenSG
does what you sayd.
> > 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 ?
Yes, I think suppressing it would be a good thing, at least for me.
Removing it, of course would be bad, I agree....
> 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.
It sounds trivial but it's not so obvious to program (e.g. unreferenced
uniforms are removed, thus you got to have knowledge of the semantics
and not just plain syntax...). We had a discussion on that last year.....:
http://www.mail-archive.com/[email protected]/msg05013.html
Unfortunately since then compilers and OpenGL/SG hasn't improved much on
that :-)
Thanks&Regards,
Toni
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users