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
3
votes
1 answer

Are there any non-mobile graphics cards that don't support "precision highp float"?

I know it is common for mobile phones to not support 'precision highp float' in fragment shaders, but are there any desktop or laptop GPUs that don't support it? In other words, if I'm only writing my shader code for use in desktop/laptop…
Baxissimo
  • 2,629
  • 2
  • 25
  • 23
3
votes
0 answers

How can I implement the Histogram Equalization in android using opengl es

I want to implement a Histogram Equalization filter in my android app with opengl es.I traverse all texture coordinates in my fragment shader to find out the mapping array.But seems like all the value in these arrays are 1 which cause the wrong…
吴高翔
  • 31
  • 1
3
votes
0 answers

GLSL: Choosing which texture to use in the fragment shader by indexing into a uniform array of structs based on the world-position of the fragment

I am working on a C++ program which displays a terrain mesh using GLSL shaders. I want it to be able to use different materials based on the elevation. I am trying to accomplish this by having an uniform array of materials in the fragment shader…
Stibius
  • 93
  • 6
3
votes
1 answer

How to use Pivot Point in Transformations

How to translate object using Center point I have a rectangle which has a center point away from the position of rectangle. when i rotate rectangle it rotates around its center axis. if i multyply position before rotation in the modelView…
user8028736
3
votes
1 answer

Why only half of expected output using texture coordinate wrapping modes, example from SB OpenGL

wrap.py from Superbible OpenGL is rendering only half the expected output. Note the two images. What could be wrong in the source code as it seems ok, there should be the four textures, why are the two missing? Thanks. Actual results that I'm…
Stan S.
  • 237
  • 7
  • 22
3
votes
1 answer

OpenGL: Do compute shader work groups execute in parallel?

It is clearly stated here that compute shader invocations are executed in parallel within a single work group. And we can synchronize their accesses to memory via barrier() + memoryBarrier() functions within that single group. But may actually…
Emil Kabirov
  • 559
  • 4
  • 14
3
votes
1 answer

Is it possible to write into specific mipmap level in fragment shader?

I have created a classic 2D a texture, and rendered into some values, in my case depth. In the c++ code I use the glGenerateMipmap() function to auto generate mipmaps. In fragment shader I can access the texture, like a normal sampler2D uniform, and…
Richard T
  • 37
  • 7
3
votes
1 answer

How to express tetration function, for complex numbers

There do exists so-called hyperoperation sequence. It works like you construct multiplication a*b=a+a+a+a...+a with many additions of a repeated b times. Then there goes exponentiation a^b = a*a*a*a*...*a with many multiplicaitions of a repeated b…
xakepp35
  • 2,878
  • 7
  • 26
  • 54
3
votes
5 answers

OpenGL: Compute eye space coord from window space coord in GLSL?

How do I compute an eye space coordinate from window space (pixel in the frame buffer) coordinates + pixel depth value in GLSL please (gluUnproject in GLSL so to speak)?
Razzupaltuff
  • 2,250
  • 2
  • 21
  • 37
3
votes
1 answer

Texture coordinates shift when apply Y rotation in vertex shader

Im trying to rotate plane from two triangles in shader. everything goes fine except i cant understand what with the UV coordinates values happens when i applying rotation. How i can perform this rotation with expected results? this looks as UV…
Stranger in the Q
  • 3,668
  • 2
  • 21
  • 26
3
votes
1 answer

How do I query the alignment/stride for an SSBO struct?

I'm not sure which structure layout is most suited for my application: shared, packed,std140, std430. I'm not asking for an explanation of each, that information is easy to find, it's just hard to figure out the impact each will have on vendor…
Mr. Smith
  • 4,288
  • 7
  • 40
  • 82
3
votes
2 answers

GPU Usage in a non-GLSL OpenGL Application

I read from the OpenGL Wiki that current Modern GPUs are only programmable using shaders. Modern GPUs no longer support fixed function. Everything is done with shaders. In order to preserve compatibility, the GL driver generates a shader…
fatarms
  • 543
  • 10
  • 19
3
votes
1 answer

Why don't these mismatched shader variables produce a linker error?

I am trying to throw an exception and abort my program when something fails during shader compile and link. I have introduced a typo: naming the output variable from my vertex shader something different from the expected input variable in my…
Brennan Vincent
  • 10,736
  • 9
  • 32
  • 54
3
votes
3 answers

GLSL + OpenGL Moving away from state machine

I started moving one of my projects away from fixed pipeline, so to try things out I tried to write a shader that would simply pass the OpenGL matrices and transform the vertex with that and then start calculating my own once I knew that worked. I…
Justin Meiners
  • 10,754
  • 6
  • 50
  • 92
3
votes
1 answer

ThreeJS FBO Particle Lighting and Shadows

Update: I decided to implement a simple lighting solution from this link, http://blog.edankwan.com/post/three-js-advanced-tips-shadow, suggested by ScieCode. It's the first part of the linked page. The result can be seen in the picture at the…
M1ke
  • 239
  • 2
  • 11