I disagree that it is not something for OSG to work around. ATI will accept the name of the uniform without the [], but OSG validates the names directly, making it so you can't bind that uniform name. So one could write code that would work with the same shaders and the same code on both ati and nvidia using direct OpenGL code, but not with OSG. Plus, you can't ifdef ATI. It's also very hard to detect if you should use [] or not because you can't see what the names of the parameters are until after the shader is compiled. We have a system where we bind uniforms in an XML file. We don't want to make an ATI version and an NVIDIA version.

If OSG just stripped off the [] when checking the names, it would work for all cases. OSG already works around implementation details, picks the right extensions to use for point sprites, etc. OSG should do all it can to make the code work the same on different drivers and vendors implementations.


---
David Guthrie
[EMAIL PROTECTED]
Alion Science and Technology
BMH Operation - A CMMI Maturity Level 3 Organization
5365 Robin Hood Road, Suite 100
Norfolk, VA 23513-2416
(757) 857-5670, ext 269, Fax (757) 857-6781




On Jan 29, 2008, at 10:56 AM, Mike Weiblen wrote:

Hi,

Agreed this is not for OSG to workaround.
But rather than do without arrays, couldn't your app conditionally
append the "[0]"?
Not clear why this is a showstopper.  Just curious.

-- mew


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:osg-users-
[EMAIL PROTECTED] On Behalf Of Christian Muschick
Sent: Tuesday, January 29, 2008 4:38 AM
To: [email protected]
Subject: [osg-users] ATI GLSL bug regarding uniform arrays?


Hello!

There seems to be a bug in ATI OpenGl drivers when using uniform
arrays.
For e.g. the uniform array "float arr[3]" I have found that
getUniformLocation("arr") returns an error while
getUniformLocation("arr[0]") returns the desired value.

This is in clear contrast to the glGetUniformLocation documentation,
where it says:
"... Except if the last part of name indicates a uniform variable
array,
the location of the first element of an array can be retrieved by
using
the name of the array, or by using the name appended by "[0]"."

Has anybody else experienced this issue? I expect no workaround will
be
implemented in OSG, so I'll have to do without array uniforms?

If nothing else, this should warn anybody searching for ATI and array
uniforms...

regards
cm
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-
openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to