Live data from Hacker News

Primer: Shaders

notes.underscorediscovery.com

31–36 of 36 posts

Re: Primer: Shaders

#31
post #28

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…

You're welcome! Please let me know if you have any other questions. I'll do my best to help. :)

Re: Primer: Shaders

#32

While 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…

Bottlenecks and multi-sample output are complex subjects, and also uncommon for a beginner to deal with.

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

#34

self promotion: Here's some more. http://greggman.github.io/webgl-fundamentals/ In particular http://greggman.github.io/webgl-fundamentals/webgl/lessons/w...

I was just going over these the other day. Thank you!

Re: Primer: Shaders

#35
post #23

What 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?

Windows has GLSL as well.

Re: Primer: Shaders

#36

self promotion: Here's some more. http://greggman.github.io/webgl-fundamentals/ In particular http://greggman.github.io/webgl-fundamentals/webgl/lessons/w...

Have been going through those to learn how to build out the rendering for my game framework. Awesome stuff! Your tutorials have saved me a lot of grokking time.
Post reply on HN