PDA

View Full Version : opengl 3.x shader only drawing ?



lobbel
09-17-2010, 10:36 AM
Hello,
I created a VBO and a VAO and therefor defined the vertex attributes and also in my shader. Binding the shader and drawing the vbo works. But with out shader it doesnt work, well it draws just nothing. Is there only the way drawing the vbo by need of a shader ?

regards,
lobbel

Dark Photon
09-20-2010, 06:30 PM
I created a VBO and a VAO and therefor defined the vertex attributes and also in my shader. Binding the shader and drawing the vbo works. But with out shader it doesnt work, well it draws just nothing. Is there only the way drawing the vbo by need of a shader ?
No, you can render with vertex attributes stored in VBOs without having to render with shaders if you want.

However, if you are going to render without a shader (i.e. with the fixed-function pipeline), then you should use the "legacy" vertex attributes (e.g. glVertexPointer, glNormalPointer, etc.), not the newer "generic" vertex attributes (glVertexAttribPointer) for portability.

On NVidia there is a correspondence between legacy vertex attributes and generic vertex attributes, but this does not exist on other vendors. So best to just use legacy vertex attributes when you don't want to render with a shader.