PDA

View Full Version : opengl 3.x questions



iop(engl)
03-12-2010, 04:19 AM
Hey

Yeterday I played around with some Opengl 3.x tutorials and now I have some questions...
Do I have to use shader for rotation, translation and scaling objects? I never used shader before... Which shader tutorials are up to date?

Thanks!

dCelsius
03-12-2010, 06:31 AM
As far as I know, you don't need to use any shader for rotation (and on).

And don't know which one are up to date. Try to get a book about shaders and read it (The Orange book is a good one, I think), I think it's better then tutorials.

Orange book (amazon):
http://www.amazon.com/OpenGL-Shading-Lan...4233&sr=8-1 (http://www.amazon.com/OpenGL-Shading-Language-Randi-Rost/dp/0321637631/ref=sr_1_1?ie=UTF8&s=books&qid=1268404233&sr=8-1)

zeoverlord
03-12-2010, 07:05 AM
If your running in non backwards compatible mode, you do have to use shaders to be able to draw polygons and get something rendered.
You also have to create the rotation/translation matrices yourself.

Go here (http://www.flashbang.se/index.php?id=56) for a tutorial on how openGL3.x works

ZbuffeR
03-12-2010, 07:44 AM
The official GL wiki as good up-to-date material :

OpenGL 3.1 first triangle win32 (http://www.opengl.org/wiki/Tutorial:_OpenGL_3.1_The_First_Triangle_%28C%2B%2B/Win%29)

OpenGL 3.2 context with cross-platform SDL (http://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Co ntext_in_SDL_%28C_/_SDL%29)

Alfonse Reinheart
03-12-2010, 11:25 AM
Do I have to use shader for rotation, translation and scaling objects? I never used shader before...

Define "have to."

As long as you create a compatibility context (which you get automatically with normal GL context creation), no, you don't have to.

However, you're not really going to be able to do much with GL 3.x and above without shaders. At least, nothing that you couldn't do with GL 2.1.

In short, you don't need to change your code, but your rendering won't look better.