3D: Shaders

did some research on shaders:

FROM: http://en.wikipedia.org/wiki/Shader
A shader is a set of software instructions, which is used to calculate rendering effects on GPU. Shaders can program the GPU's programmable rendering pipeline (as opposed to Fixed Function Pipeline, or FFP). Shaders replaces the FFP.

Shaders help determine the traits of a vertex or pixel. There are 3 types of shaders:
1. Vertex shaders: these are run once per vertex. manipulates position, color and tex-coordinates of vertices.
2. Geometry shaders: can add or remove vertices from a mesh (caused by plane-clipping, etc).
3. Pixel/fragment shaders: determines trait of a single pixel (color, z, alpha). typically used in scene lighting, bump-mapping, color toning.

Programming shaders can be done in the following 3D languages: OpenGL, DirectX.
1. DirectX for ATI uses HLSL (high level shader language)
2. DirectX for NVidia uses Cg (C for graphics, very similar to HLSL)
3. OpenGL uses GLSL (OpenGL Shading Language)

No comments: