Deady Online

Delivering information to the world. You are always welcomed to join!
 
AcasaPortalCalendarFAQCautareMembriGrupuriInregistrareConectare

Distribuiti | 
 

 Shaders issues, drawing not displayed correctly, fixing guide

Vezi subiectul anterior Vezi subiectul urmator In jos 
AutorMesaj
Oscuridao
Admin


Mesaje : 330
Data de inscriere : 27/08/2011
Varsta : 22
Localizare : Romania

MesajSubiect: 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
Sus In jos
Vezi profilul utilizatorului http://deady.dk-one.com
 
Shaders issues, drawing not displayed correctly, fixing guide
Vezi subiectul anterior Vezi subiectul urmator Sus 
Pagina 1 din 1

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