Sign in to follow this  
TiKu

Transform Feedback: Stream to various VBOs?

Recommended Posts

Hi, I want my geometry shader to write different triangles to different vertex buffer objects. Let's say triangles of type 'A' shall land in VBO 'vboA' and triangles of type 'B' in VBO 'vboB'. My idea is to write the vertex positions, texture coordinates and normals of triangles of type 'A' to different output varyings than those of the type 'B' triangles:
// shader:
varying out vec4 vertexPos_A;
varying out vec4 vertexPos_B;
varying out vec3 vertexNormal_A;
varying out vec3 vertexNormal_B;
varying out vec2 textureCoords_A;
varying out vec2 textureCoords_B;

if(triangleType == 'A') {
  vertexPos_A = ...;
  vertexNormal_A = ...;
  textureCoords_A = ...;
  EmitVertex();
} else if(triangleType == 'B') {
  vertexPos_B = ...;
  vertexNormal_B = ...;
  textureCoords_B = ...;
  EmitVertex();
}
Transform feedback would have to be setup in a way, so that the *_A varyings are streamed to vboA in interleaved mode and the *_B varyings are streamed to vboB in interleaved mode. Reading the transform feedback specs, this cannot be done, am I right? It seems to be possible to stream each of the 6 varyings to different VBOs, so I would end up with 6 VBOs. But 6 VBOs are too many, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV is only 4 for my Geforce 8. Is there really no way to stream to more than 1 VBO in interleaved mode? Thanks TiKu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this