Login  Register

Re: Can someone go over the mechanics of rendering shaders and texture objects

Posted by elect on Feb 12, 2016; 5:38pm
URL: https://forum.jogamp.org/Can-someone-go-over-the-mechanics-of-rendering-shaders-and-texture-objects-tp4036186p4036209.html

ElvJOGL wrote
Is it a netbeans project?
Yep

ElvJOGL wrote
Can I dissect your helloTriangle project?

For instance, what's do you mean by initVbo, initIbo, and initVao.

I know that they are used to initialize your buffers, but could you explain the relations between all of them.

I really want to understand the basis of this.

Thanks.
Sure, so, initVbo initializes the Vertex Buffer Object, where you store the position of your vertices
initIbo the Index Buffer Object, where you store the indices that indicates which vertex fetching from the vbo
initVao initializes the Vertex Array Objects, that is an object that stores the vertices attributes, basically all this stuff

So instead calling all those calls inside the display() method, there is the vao that remembers all that for you, so you set them inside the vao at begin and then you just need to use (bind) the vao.

notice that we bind the element_array_buffer (ibo) and we left it bound because it is part of the vao. Different story for the vbo, the vbo is not part of the vao, but it has to be bound when you call the corresponding glVertexAttribPointer