Cg Programming/Surface Shaders


Unity's Surface Shaders provide a simplified way of programming Cg shaders by automatically adding shader code for lighting and shadow computations such that programmers only need to specify material constants.

Unity offers a tutorial with a Gentle Introduction to Shaders and videos of a training session about Writing Your First Shader in Unity.

If you already know Cg, the shader examples in Unity's documentation and the source code of built-in surface shaders are very useful to understand Surface Shaders.


< Cg Programming

Unless stated otherwise, all example source code on this page is granted to the public domain.