Replacement of deprecated variables

I’m trying to understand the GLSL 1.40 and OGL 3.1 spec, but there is something I can’t get to grasp.

In the GLSL spec, pp. 65-69, all the built-in variables are tagged as “deprecated”. But what can we do then to gain access to the gl_ProjectionViewMatrix for example ?

A solution would be to set it manually in a uniform variable (or block if many variables) from the GL code. But it seems pretty cumbersome to me… And if we want other parameters now deprecated, we have to write all the wrapping in the GL code. Not very convenient…

As I understand things, there is no such thing as “ftransform” anymore because all the data have to be sent packed into Vertex Arrays / Vertex Buffer Objects. So, it is no more possible to use glutTeapot and get back gl_Normal in the shader without using some deprecated features ?

I’m quite lost in there, thanks for any help ! Of course, it would be interesting to know “why” they made such decisions (or not).

(I saw there is a topic on a similar subject down there, but I don’t get the answers, so I thought it would be a good thing to have a clear reference to this problem - which I think must be quite natural to newbies)

oh and by the way, we shouldn’t use glRotate, glScale, glTranslate, glFrustum, … (p. 296 of the GL spec). What do we do instead ?

I guess it is the “real” answer to my first question: as there is no need to use gl_ViewProjectionMatrix (since the matrix stack seems to be deprecated), it is deprecated. So, we have to maintain ourselves a matrix stack and view/model transformations ?

Thanks for any help

Yes, apparently for pure 3.1, one has to do this by hand.

So, no more gluLookAt ?

OK, this article explains it clearly :
http://www.skew-matrix.com/bb/viewtopic.php?f=3&t=4

We have to do the math on our side now. And finally, it is not that bad : we gain full control on what is going on.

Yes, we have to do everything by ourselves. At beginning it looked really strange to me too but, in fact, it’s really really convinient. It’s much more powerful, we have a finer control, and the GLSL programs look cleaner to me.

Bref, c’est une très très bonne chose ^^.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.