Hot answers tagged

2

I figured out the cause of the problem. I had to clear the depth buffer before rendering the screen filling quad, even though I switch the frame buffer. Apparently the quad culls the objects behind it, causing the textures not to appear I did glClear(GL_DEPTH_BUFFER_BIT) before I unbound the FBO. This fixed the issue for me.


2

You do exactly the same thing. You have an initial (mode space) position as a 3-component vector, turn it into a 4-component vector by setting the 4th component to 1.0. Then you have the model-to-world transformation matrix in a 4x4 matrix instance, so you can perform matrix multiplication of the 4x4 matrix with the 4x1 "matrix" that is the vector. Most ...


2

Opengl has column major orderibg system, so when you put the tx to the m03 position, you put it in the first column's last row. Transpose it.


2

Probably. As a general rule, if some function of some API is documented (explicitly or implicitly) as being capable of failure, you should account for that failure. This means you check for the failure directly (checking the return value in the case of SDL_GL_SetAttribute) or you ensure earlier in your code that the conditions leading to failure cannot be ...


1

There are a couple potential reasons why it doesn't work: you have not enabled the Vertex Attrib 3: glEnableVertexAttribArray(3). you have not told GL where to find the color attribute: glBindAttribLocation(..., 3, "i_color") before linking. You should be doing the same thing for position, as Gabriel Roy mentioned, if you didn't yet.



Only top voted, non community-wiki answers of a minimum length are eligible