Questions tagged [glsl]

GLSL is the OpenGL shading language. Use this tag for questions which are specifically about shaders written in this language. For generic shader questions use [shader] instead.

Filter by
Sorted by
Tagged with
7 votes
2 answers
697 views

What factors affect which shader language to learn?

I don't know any shader languages. I've heard of GLSL and HLSL, and I'm interested in learning one or both. Are there significant differences between them that would make one or other better in ...
trichoplax is on Codidact now's user avatar
12 votes
1 answer
9k views

Why is accessing textures much slower when calculating the texture coordinate in the fragment shader?

When using textures in GLSL, it is best to calculate the final texture coordinates in the vertex shader and hand them over to the fragment shader using varyings. ...
Nero's user avatar
  • 1,310
10 votes
1 answer
892 views

Trying to implement Microfacet BRDF but my result images are wrong

I am trying to implement microfacet BRDF model. I am reading Sebastien Lagarde's slides. I implemented formulas to my code but i think result image is wrong. Yellow is base color of material. ...
hmkum's user avatar
  • 131
40 votes
4 answers
22k views

Sharing code between multiple GLSL shaders

I often find myself copy-pasting code between several shaders. This includes both certain computations or data shared between all shaders in a single pipeline, and common computations which all of my ...
Martin Ender's user avatar
  • 2,720
71 votes
6 answers
51k views

How can I debug GLSL shaders?

When writing non-trivial shaders (just as when writing any other piece of non-trivial code), people make mistakes.[citation needed] However, I can't just debug it like any other code - you can't just ...
Martin Ender's user avatar
  • 2,720
14 votes
1 answer
2k views

When to disable perspective correct interpolation ( noperspective )

In GLSL, perspective correct interpolation of vertex attributes is the default setting - one can disable it for specific vertex attributes by using the noperspective qualifier. Other than in post-...
gemse's user avatar
  • 243

1 2 3 4 5
6