Hi
 
RigGeometry vertex\normal arrays updated according to animation when software rig transform implementation is used. Have a look at RigTransformSoftware::operator() source. If you set vertex position with setVertexAttribArray, it woudnt be updated, else if you set it with setVertexArray it would be overwritten with array calculated by rig transform implementation. If you just need transformed values - use gl_Vertex in shader, and dont touch vertex array.
 
Cheers.
 
06.09.2012, 14:54, "Peterakos" <hay...@gmail.com>:
Hello.
My task is to render an animated dae character with shaders.
I have created a simple vertex shader:
attribute vec4 position_attribute;
attribute vec4 color_attribute;
varying vec4 color; 
void main(){
color = color_attribute;
gl_Position = gl_ModelViewProjectionMatrix * position_attribute;
}
 
After that i use stateset->setAttributeAndModes to assign the program to the model .
I assign the position and color atrtibute to the corresponding location according to this:
gl_Vertex0
gl_Normal2
gl_Color3
gl_SecondaryColor4
 
Everything works fine.
The problem comes when i try to pass manually the vertex array and color array using:
geom->setVertexAttribArray(attrib_num, data_array);
geom->setVertexAttribBinding(attrib_num, attrib_binding);
 
I pass the RigGeometry's VertexArray as data array, but the character is not animated because the default
geometry's values are passed. Watching the osganimationhardware example i noticed that i have to pass the bone matrices
as well and multiply with vertex position.
Is there any Array which keeps the updated vertex positions according to the animation?
If there is, i can match this array's values to position attribute, without having to pass the matrices in the shader.
Thank you for your time and sorry for the long post.
,

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to