It is currently Wed Nov 22, 2017 10:35 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: Shader VMK 26 - OpenGL 3.3 Core Profile
PostPosted: Mon Jul 08, 2013 5:44 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
In this VMK we finally get to updating the OpenGL rendering context to use the v3.3 Core Profile Specification. The GLU library is removed from the project and the desired openGL version number is now passed from the Game class to the Engine class.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 26 - OpenGL 3.3 Core Profile
PostPosted: Wed Jul 10, 2013 10:04 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
Excellent transition. It was simple to follow, now we are getting to the good stuff. Starting to port the GameEngine over. Oh and Congratulations on your new born. :)


Offline
 Profile  
 
 Post subject: Re: Shader VMK 26 - OpenGL 3.3 Core Profile
PostPosted: Sun Jan 26, 2014 12:51 pm 

Joined: Sun Jul 21, 2013 5:17 pm
Posts: 17
Hi, i have a problem with glUniformMatrix4v. Seems like my graphic card can not initialize this function O.O I have a geforce gtx 285 opengl 3.3 compatible

stdafx.h
extern PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4v;


stdafx.cpp
PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4v = NULL;


engine.cpp
strApiName = "glUniformMatrix4v";
   if( (glUniformMatrix4v = (PFNGLUNIFORMMATRIX4FVPROC)wglGetProcAddress( strApiName.c_str() ) ) == nullptr ){
      strStream << strApiName;
      throw ExceptionHandler( strStream );
   }

But in runtime it's throwing error here :-(
Any idea?

Thank you =)

EDIT:
... glUniformMatrix4fv not glUniformMatrix4v.

fixed :|


Offline
 Profile  
 
 Post subject: Re: Shader VMK 26 - OpenGL 3.3 Core Profile
PostPosted: Thu May 14, 2015 7:16 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Note the following if you are using a newer version of the GLM library than what I started with in the VMK series:

skilz80 wrote:
when I was looking inside the Game constructor I was looking at the calculation that we save into our member variable for the projection matrix and I seen the glm::perspective call. Then it had dawned on me, about a comment that I had made in another post thread on the forums about GLM Math Library with their newer versions forcing radians as opposed to degrees. So this is what your video has using the older GLM library
   const glm::uvec2 gamePixelSize = m_pSettings->getGameSize();
   float fAspectRatio = gamePixelSize.x / static_cast<float>( gamePixelSize.y );
   m_m4Projection = glm::perspective( 45.0f, fAspectRatio, 0.1f, 100.0f );
which is correct, however with GLM 0.9.5.1 they inquire about using their flag to force radians for their math library function calls. In think in version 0.9.5.5 and above this flag is automatically set by default. And in version 0.9.6.0+ all functions that used degrees are deprecated and now use radians. So If you still want to use degrees for angles with GLM 0.9.5.1+ or preferably 0.9.6.2 or 0.9.6.3 then your source should look like this instead:
   const glm::uvec2 gamePixelSize = m_pSettings->getGameSize();
   float fAspectRatio = gamePixelSize.x / static_cast<float>( gamePixelSize.y );
   m_m4Projection = glm::perspective( glm::radians( 45.0f ), fAspectRatio, 0.1f, 100.0f );
I just want to stress this fact so that others do not have rendering versus scaling problems along with rotations when we get deeper into the shader engine series and start to do animations with multiple objects in the game's render window. I would suggest using the newer library but make sure every function call that takes in an angle value for its parameter is either already defined in radians, or simply pass your degree of angle into glm::radians( your angle of degree ) right into your calculations or glm methods.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron