Follow that and your fine. Or if in 2D, u can use glOrtho(0,windowwidht, 0, windowheight); and then your g_vertex_buffer just holds pixel locations instead of -1 to 1 values.
The matrix generated by glOrtho can be found in any decent documentation or reference manual. Your favorite linear algebra library should also contain functions to generate orthogonal projection matrices. Just multiply your vertices by that matrix in your vertex program.
The matrix generated by glOrtho can be found in any decent documentation or reference manual. Your favorite linear algebra library should also contain functions to generate orthogonal projection matrices. Just multiply your vertices by that matrix in your vertex program.
Then I have to create the matrix at the shader level? or is there a way to pass a custom data type to the shader as an attribute