Login  Register

Re: Possible to use vertex shader without vbo?

Posted by Xerxes Rånby on May 27, 2015; 10:32pm
URL: https://forum.jogamp.org/Possible-to-use-vertex-shader-without-vbo-tp4034532p4034533.html

sirus20x6 wrote
Is it possible to use a vertex shader without your vertex data being in a VBO?
Yes GL2, GLES2 and backward compatible GL3bc & GL4bc has a
gl.glVertexAttribPointer
that takes a Buffer instead of using a vbo offset.
https://jogamp.org/deployment/v2.3.1/javadoc/jogl/javadoc/com/jogamp/opengl/GL2.html#glVertexAttribPointer%28int,%20int,%20int,%20boolean,%20int,%20java.nio.Buffer%29

If you want to see the difference in use you may look at this commit that changes one of the jogl-demos from using glVertexAttribPointer that takes a Buffer into glVertexAttribPointer that uses the last bound VBO.
https://jogamp.org/git/?p=jogl-demos.git;a=commitdiff;h=84a886cf4957e8f55af39abf8e9bad04a1de2e4f

Newer GL3 & GL4 drivers have dropped backward compatible support thus if you want your code to run using the latest OpenGL versions and drivers you will have to use vbo.