Can I use a vertex shader to display a models normals?

Posted by geowar on Stack Overflow See other posts from Stack Overflow or by geowar
Published on 2009-10-23T22:31:20Z Indexed on 2010/06/01 10:53 UTC
Read the original article Hit count: 180

Filed under:
|
|

I'm currently using a VBO for the texture coordinates, normals and the vertices of a (3DS) model I'm drawing with "glDrawArrays(GL_TRIANGLES, ...);". For debugging I want to (temporarily) show the normals when drawing my model. Do I have to use immediate mode to draw each line from vert to vert+normal -OR- stuff another VBO with vert and vert+normal to draw all the normals… -OR- is there a way for the vertex shader to use the vertex and normal data already passed in when drawing the model to compute the V+N used when drawing the normals?

© Stack Overflow or respective owner

Related posts about opengl

Related posts about shader