what are shaders?

Quote:


A shader is basically the set of rules on how an object looks. The rules can be almost anything but there are are a lot of established routines to make this task a lot more simple for us. There are rules that can describe how objects react to lighting, functions to read texturemaps, fetch reflections and refractions and so on. Shaders can be formulated to look like real physical materials or shaders can be written to look like cartoon surfaces or even output technical data, such as distance from camera.

Shaders are also not limited to surface colour only - there are different type of of shaders: shaders can manipulate the shape of an object (displacement shaders), describe the atmosphere (fog shaders) and how light and shadow is cast (light shaders and shadow shaders).




The basic concepts behind shaders

Quote:


Basic surface shaders usually can be split up into a few concepts. The resulant colour of a surface is a mathematical combination of the following properties.

* illumination- ambient, diffuse, specular, sub-surface and indirect
* raytracing- reflections, refractions and related phenomena like fresnel
* texturemapping- procedural and map-based colourisation of a surface
* bump mapping- this is how we can affect how the lighting affects a surface by "fooling" the renderer into thinking that your object has parts of it facing in different directions. this give the illusion of more modeled detail in your geometry.





Here's an intro to High Level Shading Language (HLSL).


So Many Toys... So Little Time. A place to lurk while you work > irc://irc.webchat.org/3DGS