Part of the confusion is the confusing terminology. "Shader" is a bad name. How do you "shade" a vertex? That implies color, when in fact vertex "shading" is really about deforming the position of vertices. It has nothing to do with color! "Vertex program" is a better term. That brings us to "pixel shader." That's actually a good name in order for beginners to learn the concept, but it's imprecise. OpenGL insists on…
"Anyway, it's just a tiny program that executes either per-vertex or per-pixel." Thank you. I have never understood the concept of a -shader; I just knew they were useful and somehow caused neat effects. Even having pasted some shader code into a program once (for a barrel distortion for my rift), I never thought much about them, likely because of the opacity of the name. Just ... magic. Your description has just mad…
Primer: Shaders
31–36 of 36 posts
Re: Primer: Shaders
#32While I appreciate the effort, I think this primer is lacking what most other shader tutorials also lack: any information on how to actually do something useful. Shaders are used because they are faster than the cpu. So why isn't everything done with shaders? Because of limitations. So what are those? Most GPU tutorials only include examples of the form FragColor = That's nice, but hardly useful. To do anything of wo…
Nevertheless, gonna just pimp my own tutorials since they also cover practical implentations, like blurs for desktop and mobile, normal mapping for 2D games, vignettes, etc. https://github.com/mattdesl/lwjgl-basics/wiki/Shaders
Re: Primer: Shaders
#33Also gonna jump on the bandwagon with my own tutorials, using Java/LibGDX and mostly focusing on 2D applications.
Re: Primer: Shaders
#34self promotion: Here's some more. http://greggman.github.io/webgl-fundamentals/ In particular http://greggman.github.io/webgl-fundamentals/webgl/lessons/w...
Re: Primer: Shaders
#35What shader languages are used in cross-platform games? PS3 uses Cg, PS4 PSSL, Xbox & Windows use HLSL and OpenGL on Mac/Linux/Smartphones/Tablets use GLSL. Are there converters from one to the other language? How do big engines like Unreal oder CryEngine handle this?
Re: Primer: Shaders
#36self promotion: Here's some more. http://greggman.github.io/webgl-fundamentals/ In particular http://greggman.github.io/webgl-fundamentals/webgl/lessons/w...