Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Transform feedback problem

Started by donguow 0 replies 1.2k views
Original Post
donguow
donguow
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
donguow
donguow
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.