Deady Online
Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

Deady Online

Delivering information to the world. You are always welcomed to join!
 
AcasaPortalUltimele imaginiCăutareÎnregistrareConectare

 

 Shaders issues, drawing not displayed correctly, fixing guide

In jos 
AutorMesaj
Oscuridao
Admin



Mesaje : 352
Data de inscriere : 27/08/2011
Varsta : 29
Localizare : Romania

Shaders issues, drawing not displayed correctly, fixing guide Empty
MesajSubiect: Shaders issues, drawing not displayed correctly, fixing guide   Shaders issues, drawing not displayed correctly, fixing guide Icon_minitimeDum 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
Sus In jos
https://deady.forumgratuit.ro
 
Shaders issues, drawing not displayed correctly, fixing guide
Sus 
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
Deady Online :: Others :: Altele!-
Mergi direct la: