When no pixels are appearing, ALWAYS begin drawing your first triangle with an untransformed vertex shader (output = input), and a solid color output in the fragment shader. If you can't see anything, you've either incorrectly provided vertices or set your viewport/window up wrong.
One thing you could look at is what is happening to your z coordinates. In opengl, all vertices must have xyz for a valid position.
Opengl clips off all geometry that is outside of the clip space, and I suspect your ortho projection matrix has incorrect near/far clip values (z values of 0 are clipped because they do not fall into your range of 0.1-100.0)
what is happening to your z coordinates Opengl clips off all geometry that is outside of the clip space,...
Aha! I don't use the Z axis whatsoever. I also don't even use 3 coordinates when I specify, to opengl, how many coordinates I am using for spacial position. So maybe I can play around with that, as it might be clipping it because the matrix transforms it out of scope.
ALWAYS begin drawing your first triangle with an untransformed
I've always defaulted to printing the shit out of variables, and when I can (GLSL yay!) I resort to primitive builds. So I know that the primitive builds went okay (as I stated, I could get it to draw without the projection matrix.)
Perhaps I can use just the projection matrix as the only thing on the matrix stack and try to mess around from there if my Z axis crap doesn't work. I wonder what would happen if I take depth test off and keep using it the way I have had it, as it could stop the erase of the geometry that is out of scope...
2
u/kikkurs Feb 11 '16
Some ideas:
When no pixels are appearing, ALWAYS begin drawing your first triangle with an untransformed vertex shader (output = input), and a solid color output in the fragment shader. If you can't see anything, you've either incorrectly provided vertices or set your viewport/window up wrong.
One thing you could look at is what is happening to your z coordinates. In opengl, all vertices must have xyz for a valid position.
Opengl clips off all geometry that is outside of the clip space, and I suspect your ortho projection matrix has incorrect near/far clip values (z values of 0 are clipped because they do not fall into your range of 0.1-100.0)