gl_Vertex as ivec4

gl_Vertex is vec4 by default, but I need it to be ivec4 to do compression. Is there a way to redefine gl_Vertex as ivec4 or should I define an additional attribute with the same pointer location as the position? It should work on dx 10 cards, meaning only on g8 and g9 series.

Is it possible to render an vertexbuffer withou specifing a position?

Thanks in advance.

You need to use the standard glVertexPointer or generic vertex attribute zero. Otherwise nothing should be rendered based on specification (note that in the past, some implementations rendered geometry even if they should not).

If you need to use formats for which the standard vertex array is not sufficient, you need to create generic attribute and explicitly bind it to the attribute zero to ensure that something is bound to that slot.

Hmmm, it would be cool if a future version of the spec relaxed the requirement of the vertex position attribute. Lots of things are possible with gl_VertexID and gl_InstanceID :wink:

Is there a way to redefine gl_Vertex as ivec4

No, you cannot change built-in gl_ attributes.

should I define an additional attribute with the same pointer location as the position

That sounds like waste of an attribute.

Is it possible to render an vertexbuffer without specifing a position?

You can use generic attributes in any way you like, but you must bind one attribute to location 0 or your vertex shader will not be invoked. What that data means is your choice inside the vertex shader.

There you got it, triple post!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.