vertex deceleration in OpenGL

Started by
2 comments, last by V-man 12 years, 10 months ago
can i create vertex deceleration in OpenGL (OGL 2 or 3)( like as d3dx) instead calling vertex attrib pointers in every draw call ?
Advertisement

can i create vertex deceleration in OpenGL (OGL 2 or 3)( like as d3dx) instead calling vertex attrib pointers in every draw call ?


vertex "deceleration" is simple. Make sure you use unaligned and bloated vertex data in cache unfriendly order.

A "not as far as I know" to the question you probably meant to ask about vertex format declarations.
f@dzhttp://festini.device-zero.de
Vertex Array Objects perform a similar function to vertex declarations (D3D10/D3D11) and Flexible Vertex Formats in D3D9.

It means when it comes to drawing, you bind a Vertex Array Object and your buffers and just call DrawElements.
http://www.opengl.org/wiki/Vertex_Arrays
http://www.opengl.org/wiki/Vertex_Formats
http://www.opengl.org/wiki/Vertex_Array_Object
and so on

Example with VAO
http://www.opengl.org/wiki/Tutorial1:_Rendering_shapes_with_glDrawRangeElements,_VAO,_VBO,_shaders_%28C%2B%2B_/_freeGLUT%29
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement