I was using "GLSL Version #120". But now i am trying to do one tutorial and it is using "gl_ClipDistance[0]" inside of vertex shader. And "GLSL Version #120" doesn't support "gl_ClipDistance[0]". Now i need to change GLSL Version with over #120 for example #330 . I also have to change "gl_ModelViewProjectionMatrix" inside vertex shader. But my question is i need to change glTranslate,glRotate,glLoadIdentity etc ?


Yes, you can use them, but OpenGL will not automatically transfer the resulting matrix to your GLSL, and the older built-in uniform will not be available.

What this means is you'll need to use a glGet to retrieve the matrix to your program code, followed by a glUniform to send it to your shader.

  • \$\begingroup\$ Thank you too much for your answer. I decided to use "GLM" library. I will setup Projection , View and Model matrix. And i will send them gpu with glUniform4fv right? But i did not understand this : how can i change position my meshes (objects). I could change glTranslatef(); inside glPushMatrix(); when i use "GLSL Version #120". And my second question is what is better calculate ( Projection * View * Model) inside display() function and after send one matrix to gpu. Or send all and calculate inside gpu with "GLSL". \$\endgroup\$ – Emre Kaya Nov 22 '18 at 17:07
  • \$\begingroup\$ @EmreKaya - these would be better as separate questions; the StackExchange format isn't intended for back-and-forth discussions like a forum; instead it's for separate questions with one topic per question. \$\endgroup\$ – Maximus Minimus Nov 22 '18 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.