Game Development Reference
In-Depth Information
When we are writing shaders, we need to deal with the vertex and pixel shader program-
ming. We will need to get the vertex data from our geometry, calculate the data, and pass
it out to the pixel level. At the pixel level, we will calculate the color of the geometry,
light, and shadow, and then we will get the result. This can be very complex and repetit-
ive, especially when we have to deal with lighting. It can be a nightmare. Unity 3 has
come up with a new style of writing the shader program that is shorter and sim-
pler—surface shaders—which helps us to reduce the time to write the repetitive code over
and over again. However, we still need to know the basics of Cg/HLSL programming, but
we won't go too deep into how to create a shader from scratch or how Cg/HLSL works.
We will just introduce some functions and variables that are required for our custom
shader.
Search WWH ::




Custom Search