Hi,

I'm writing some shaders to use with OSG and some use extra vertex attribute 
(such as tangent for a bump shader)

I think the OpenGL way of vertex attribute binding is :

- compile and link the shader program
- get the attribute location by calling glGetAttribLocationARB(program, 
"attributeName")
- bind the data buffer to this location

So, this way, you always use a "free" attribute location

In OSG, it seems that I have to do :

- compile and link the shader program
- bind the data buffer to a chosen location
- set the attribute location by calling 
program->addBindAttribLocation("attributeName", location)


What is the correct way to do this ?
How can I be sure to not overwrite an attribute location in OSG (for example, 
attribute locations 0, 2, 3, and 8 are often reserved for vertex, normals, 
colors, and texture coordinates by video drivers) ?

Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43842#43842





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

Reply via email to