Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Shader is a good name, because it implies what one of the main purposes of the code is: to apply lighting (shading) to the stuff.

How do you shade a vertex? Read about Gouraud shading. The idea is to do the expensive lighting calculation only at the vertices, and interpolate in-between. The "vertex shader" would calculate the shading at the vertices.

Obviously, you can use a vertex shader to do things other than shading, but "shader" is just a name, not a definition of all things this program can do.



I found the name confusing the first time I encountered it. At first, I assumed it only had something to do with applying fancy lighting effects. Only after studying things further did it become obvious that a shader is responsible for doing 3d->2d projection and pixel filling - and you need them even if you only want to draw solid color shapes!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: