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

Matrix Translation in GLSL is infinitely stretched

I work with webgl and modify the shaders (vs.glsls and fs.glsl) to understand the GLSL and graphic programming. I have a model that I want to scale, rotate and translate. Scaling and rotating works fine but when I multiply the translation matrix,…
femchi
  • 1,185
  • 8
  • 20
  • 37
3
votes
1 answer

Uniform texel buffer for Vulkan GLSL

I have an float RGBA buffer that I want to pass to my compute shader as a Uniform Texel Buffer (for read-only access with no sampling). Can someone tell me how to do this in GLSL? All examples I can find seem to be skipping that topic or have a at…
abergmeier
  • 13,224
  • 13
  • 64
  • 120
3
votes
1 answer

GLSL Passthrough Geometry Shader

I've been learning OpenGL (actually OpenTK) for a month or so, and I've started playing with geometry shaders. I originally wrote a much more complicated shader, which didn't work, so I've stripped everything down a simple passthrough shader, which…
Andrew Tofelt
  • 300
  • 2
  • 8
3
votes
2 answers

GLSL Spinlock Blocking Forever

I am trying to implement a Spinlock in GLSL. It will be used in the context of Voxel Cone Tracing. I try to move the information, which stores the lock state, to a separate 3D texture which allows atomic operations. In order to not waste memory I…
noname2
  • 31
  • 1
3
votes
2 answers

WebGL inverse FFT implementation

I am trying to implement an FFT and associated inverse FFT in WebGL using fragment shaders. I am using shader code from this github site. I believe that I am doing the FFT correctly as I am getting results that seem correct however my…
DLH
  • 199
  • 11
3
votes
1 answer

WebGL 2.0 Integer attribute throws type error if VertexAttribArray is disabled

I just spent some hours to isolate a behavior of WebGL which i don't understand. Let's assume a vertex shader with integer attribute: precision highp int; in vec4 vtx_pos; in vec3 vtx_nrm; in ivec4 vtx_int; // <- integer attribute void main() { …
user1501157
3
votes
1 answer

Implement making flake normal map texture

I am trying to implement making making flake normal map texture like this. flake normal map texture I have found this page. In the page, there is a OSL code, and I tried to implement with GLSL. But, I can't do it. I don't have an idea how to…
nack
  • 73
  • 1
  • 5
3
votes
0 answers

Running GLSL Compute shader without a graphic context

I'd like to write a GLSL compute shader that works like an OpenCL application. I'm a newbie in GPGPU so i don't even know if it is possible. The problem is that i'd like to run that program without needing a graphic server, like X11 on Unix. Is…
aegroto
  • 43
  • 3
3
votes
1 answer

Interpolation of vertexdata in OpenGL

Is it possible to configure OpenGL so that the vertex data will be interpolated in a different way than OpenGL normally does? For example, I would like to try out logarithmic interpolation
Darius Duesentrieb
  • 837
  • 10
  • 20
3
votes
1 answer

OpenGL ES3 framebuffer draw depth in red scale

So after hard work to make directional light shadow map work finally I can see a shadow map rendered on a quad but it is drawn only with depth GL_DEPTH_COMPONENT16 and type GL_UNSIGNED_SHORT , or GL_DEPTH_COMPONENT32F and type GL_FLOAT but it is in…
user8581488
3
votes
1 answer

OpenGL texture is all black when rendered with shader

I have a very simple OpenGL application that renders only one textured quad. This is my code, which works just fine (the textured quad appears just fine): // Bind the test texture glBindTexture(GL_TEXTURE_2D, mTestTexture); // Draw the…
Boris
  • 8,551
  • 25
  • 67
  • 120
3
votes
1 answer

SSAO implementation in Babylon JS and GLSL, using view ray for depth comparison

I'm trying to create my own SSAO shader in forward rendering (not in post processing) with GLSL. I'm encountering some issues, but I really can't figure out what's wrong with my code. It is created with Babylon JS engine as a BABYLON.ShaderMaterial…
Damian Taylor
  • 51
  • 1
  • 8
3
votes
2 answers

C# subclass of this base class?

So there's this component of Xamarin.ios, GPUImage, that was originally in objective c and now uses bindings to work in C#. I can't seem to get a working subclass of one of its classes, GPUImageThreeInputFilter , which is supposed to accept a…
Michael R
  • 31
  • 2
3
votes
3 answers

GLSL shaders not working. No compile errors, and used glUseProgram

I came up with code to render a rectangle, but the shaders won't work. It still has the blank white color. Here I will include the important code Main: float verts[] = { -.5f, -.5f, .0f, -.5f, .5f, .0f, .5f, .5f, .0f, .5f, .5f,…
Joseph
  • 127
  • 2
  • 10
3
votes
1 answer

Pixel perfect text rendering in perspective projection

I'm trying to render text as textured quads in perspective projection (do not want to use ortho projection), and I'm struggling with pixel alignment. The setup is simple, I have text with align anchor point in 3D, I change its model transformation…
Vojtěch Kaiser
  • 568
  • 3
  • 15
1 2 3
99
100