1) You need to call
glGenTransformFeedbacks(1, &tfID);
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
like any other function in OpenGL.
2) You specify the buffer and the shader varyings.
glBindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, 0, tfvbo ); glTransformFeedbackVaryings( pg, 1, attr, GL_INTERLEAVED_ATTRIBS); //(my cards does not support the EXT function
3) In the render function u don’t call glDraw[*] functions instead u call
glDrawTransformFeedback(GL_POINTS, tfID);
The buffer binding is taken from the tfID transform feedback buffer.
Thats it. The new way simplifies the handling of buffers.
Attached is the full source code.
Source Code
Binary (Requires freeglut and glew)
Visual Studio 2008 sln (Requires freeglut and glew)
Download solution from Google Docs
0 comments:
Post a Comment