Oscuridao Admin
Mesaje : 352 Data de inscriere : 27/08/2011 Varsta : 30 Localizare : Romania
| Subiect: Shaders issues, drawing not displayed correctly, fixing guide Dum Apr 03, 2016 7:43 pm | |
| Short fix for not displaying/ not drawing shaders, opengl programming: usage of "unnormalized screen coordinates"; -this refers to the fact the the drawing is not made in -1 to 1 range on X and Y coordinates because there was used ProjectionView, or ModelView as follows: glViewport(0,0,640,480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0,640,0,480,0,1); glMatrixMode(GL_MODELVIEW); glLoadIdentity();-these few lines of code, translates the normalized coordinates from XY -1 to 1 range into the size of your window coordinates (screen coordinates); The fix is simple, just comment those lines of code above, if you have them on your source file, and then change your draw's coordinates to the normalized ones, and recompile your project, and see if it was fixed. Get here a sample program c++ and opengl to see how shaders work | |
|