Questions tagged [glsl]

The OpenGL Shading Language (GLSL) is the standard programming language for shaders in OpenGL. There are many versions of the language, with each version corresponding to a version of OpenGL. OpenGL ES 2.0 and above have separate versions of GLSL.

The OpenGL Shading Language (GLSL) is the standard programming language for shaders in OpenGL. There are many versions of the language, with each version corresponding to a version of OpenGL. OpenGL ES 2.0 and above have separate versions of GLSL.

Information about GLSL (for desktops) can be found on the OpenGL Wiki

Versions

GLSL

OpenGL Shading Language 1.10 Specification, #version 110, OpenGL 2.0
OpenGL Shading Language 1.20 Specification, #version 120, OpenGL 2.1
OpenGL Shading Language 1.30 Specification, #version 130, OpenGL 3.0
OpenGL Shading Language 1.40 Specification, #version 140, OpenGL 3.1
OpenGL Shading Language 1.50 Specification, #version 150, OpenGL 3.2
OpenGL Shading Language 3.30 Specification, #version 330, OpenGL 3.3
OpenGL Shading Language 4.00 Specification, #version 400, OpenGL 4.0
OpenGL Shading Language 4.10 Specification, #version 410, OpenGL 4.1
OpenGL Shading Language 4.20 Specification, #version 420, OpenGL 4.2
OpenGL Shading Language 4.30 Specification, #version 430, OpenGL 4.3
OpenGL Shading Language 4.40 Specification, #version 440, OpenGL 4.4
OpenGL Shading Language 4.50 Specification, #version 450, OpenGL 4.5
OpenGL Shading Language 4.60 Specification, #version 460, OpenGL 4.6

GLSL ES

OpenGL ES Shading Language 1.00 Specification, #version 100 es, OpenGL ES 1.0
OpenGL ES Shading Language 3.00 Specification, #version 300 es, OpenGL ES 3.0
OpenGL ES Shading Language 3.10 Specification, #version 310 es, OpenGL ES 3.2
OpenGL ES Shading Language 3.20 Specification, #version 320 es, OpenGL ES 3.2

8020 questions
41
votes
6 answers

How to do ray tracing in modern OpenGL?

So I'm at a point that I should begin lighting my flatly colored models. The test application is a test case for the implementation of only latest methods so I realized that ideally it should be implementing ray tracing (since theoretically, it…
j riv
  • 3,593
  • 6
  • 39
  • 54
41
votes
4 answers

'printf' in GLSL

In C, I can debug code like: fprintf(stderr, "blah: %f", some_var); In GLSL, is there a way for me to just dump out a value in a Vertex or Fragment shader? I don't care if it's slow; I just want to dump out the value. Ideally, I want a setup like…
anon
  • 41,035
  • 53
  • 197
  • 293
39
votes
1 answer

Passing a variable to an OpenGL GLSL shader

I'm writing an iPhone app which uses GLSL shaders to perform transformations on textures, but one point that I'm having a little hard time with is passing variables to my GLSL shader. I've read that it's possible to have a shader read part of the…
39
votes
2 answers

How can I pass multiple textures to a single shader?

I am using freeglut, GLEW and DevIL to render a textured teapot using a vertex and fragment shader. This is all working fine in OpenGL 2.0 and GLSL 1.2 on Ubuntu 14.04. Now, I want to apply a bump map to the teapot. My lecturer evidently doesn't…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
38
votes
13 answers

WebGL - is there an alternative to embedding shaders in HTML?

The popular way of using GLSL shaders in WebGL seems to be to embed them in the main html file. The vertex and fragments shaders are embedded in tags like: