PDA

View Full Version : gl_VertexID issue



yagero
01-17-2011, 01:09 PM
Hi,
I tried to use the gl_VertexID attribute in my GLSL shader to draw geometry without setting any vertex attributes. I pack vertices positions in 32 bits indices array, and unpack them in my GLSL shader. If you want to learn how to do it, here is a very interesting post which helped me a lot: http://blog.blackhc.net/2009/07/from-vertex-positions-to-packed-element-arrays/

Everything works just fine on my ATI GPU. But if I try it on a NVIDIA GPU, I fail to unpack all my vertex data because the gl_VertexID attribute seems to be stored on a 16 bits, even if my draw call uses GL_UNSIGNED_INT indices. So I achieved to unpack the data stored on the first 16 bits, but the last 16 bits are empty.

Do you have an idea?
Thanks,