Jump to content
  • Advertisement
Sign in to follow this  
donguow

OpenGL Transform feedback problem

This topic is 2330 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I got a problem with Transform Feedback and hope someone here can help me out. I want to capture vertex position and vertex normal while performing rendering and save the results into a frame buffer.

Here is a peace of code used to declare attributes that I want to record:

transform feedback const GLint loc[] = {
glGetVaryingLocationNV(program, "position"),
glGetVaryingLocationNV(program, "normal"),
};
glTransformFeedbackVaryingsNV(program, 2, loc, GL_SEPARATE_ATTRIBS_NV);


This peace of code goes after compiling the shaders and prior to linking them. But when I print out the results of loc, they all are -1.

Does this situation happen to anyone else? I would really appreciate if someone give me a help.

-D

Share this post


Link to post
Share on other sites
Advertisement
I finally got it fixed. Before linking the shaders, we need to put the following commands

glActiveVaryingNV( shaderProgram, "position\0" );
glActiveVaryingNV( shaderProgram, "normal\0" );


Cheers,
-D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!