Jason Daly wrote:
I don't know if this is still true or not, but the NVIDIA drivers used
to "alias" the generic vertex attributes with the traditional
fixed-function attributes, so, for example, if you used normals in your
geometry, you couldn't use generic attribute 2 (it was occupied by the
normals).
In my GL3 development on NVIDIA drivers, the slot numbers for vertex
array variables are linear and sequential in the order the variables are
declared in the shader. But of course that gives us no information about
the case you describe, the GL2 vertex array usage.
Whether or not the driver reserves slot numbers, it seems like OSG
should query the driver for the slot number of the vertex attribute
name, just like it does for uniforms already. This would work for the
GL3 case and also for the GL1/2 non-display list case.
I understand querying vertex array slot names is a problem for GL1/2
using display lists. To use both generic vertex arrays and display
lists, the app would have to set the bindings explicitly, per the
current OSG interface. Alternatively OSG could make vertex arrays a
no-op if display lists are used, and display a warning message to
suggest switching to buffer objects. This would result in a simpler
implementation.
-Paul
The attributes mapped up like this (from the GL_ARB_vertex_program
specification):
0 vertex position glVertex
1 vertex weights 0-3 glWeightARB, VertexWeightEXT
2 normal glNormal
3 primary color glColor
4 secondary color glSecondaryColorEXT
5 fog coordinate glFogCoordEXT
6 - -
7 - -
8 texture coordinate set 0 MultiTexCoord(TEXTURE0, ...)
8+n texture coordinate set n MultiTexCoord(TEXTURE0+n, ...)
I expect this restriction has gone away with the G80-class (i.e.: OpenGL
3 capable) hardware and higher, but I haven't checked to be sure.
--"J"
_______________________________________________
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