Advertisement Jump to content
Sign in to follow this  
TRONJon

OpenGL Matrix Stack & New OpenGL Standards

This topic is 1775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I'm new to these forums... so please be gentle! :)

 

I'm just wondering if anyone has put thought towards / knows the solution to displaylists with the new openGL standards coming up in future versions.

 

What I mean is, currently we use glTranslate and glRotate etc when positioning our camera in 3D space... but I personally also use them when rendering geometry into a display list.

 

If perfectly at peace with losing these functions and working out our own custom matrices... but what if we need to modify the matrix during a list call? displaylists will only store openGL commands, ignoring my own matrix modifications?

 

Is the solution simply to make sure that calls to glVertex3f() are already transformed within the geometry without using a matrix within the displaylist?

 

 

Jon

Share this post


Link to post
Share on other sites
Advertisement

If you are worried about losing the matrix functions in the new versions, then you are also losing display lists and immediate mode rendering at the same time. Vertex arrays and shaders are the only way forward in the new versions. Also, this is not really new. The new API which dropped all the old stuff was released nearly six years ago.

 

Moving the thread from coding horrors as well, this is clearly and OpenGL topic.

Share this post


Link to post
Share on other sites


...with the new openGL standards coming up in future versions ...currently we use glTranslate, glRotate, glVertex3f...
This future version arrived in 2004! ph34r.png

Since then, the process has been to copy your final matrix values into a uniform variable directly before drawing the object.

 

If your code is based around pre-2004 OpenGL, such as glTranslate, glRotate, glVertex3f... then I would just keep going as you are!

You'd basically want to start from scratch if you wanted to start using modern OpenGL tongue.png

Share this post


Link to post
Share on other sites

Basically it boils down to replicating the same functions. Either with something like GLM, some other, or hand-rolled. And then passing to shader via uniform like Hodgman mentioned.

Share this post


Link to post
Share on other sites

 


...with the new openGL standards coming up in future versions ...currently we use glTranslate, glRotate, glVertex3f...
This future version arrived in 2004! ph34r.png

Are we talking about OpenGL 3? OpenGL 3 came out in 2008.


but what if we need to modify the matrix during a list call?

You're already using deprecated code in either a very old context or a newer context on compatibility profile, which also has matrix functions.

 

If you drop "dreprecated" functionality, you drop all of it in a core context, glBegin/End, gl matrix, client states, display lists, all of it.

Share this post


Link to post
Share on other sites


Are we talking about OpenGL 3? OpenGL 3 came out in 2008.
I was suggesting that by GL2, all the functions in the OP had been replaced with modern alternatives wink.png

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!