Documentation
Resources
Community
Paid Support
Previous
Next

ShaderLab Reference

Reference Manual > ShaderLab Reference

Shaders in Unity are written in a language called ShaderLab, which is similar to Microsoft's .FX files or NVIDIA's CgFX. If you want to write your own shaders, including custom vertex & fragment programs, this section and ShaderLab introduction will explain you how.

To get you started from some examples, we ship the ShaderLab source code for all built-in shaders. You can get them at Resources section.

Read on for ShaderLab reference, and check out ShaderLab introduction!

  • ShaderLab syntax: Shader
    • ShaderLab syntax: Properties
    • ShaderLab syntax: SubShader
      • ShaderLab syntax: Pass
        • ShaderLab syntax: Color, Material, Lighting
        • ShaderLab syntax: Culling & Depth Testing
        • ShaderLab syntax: Texturing
        • ShaderLab syntax: Fog
        • ShaderLab syntax: Alpha testing
        • ShaderLab syntax: Blending
        • ShaderLab syntax: Pass Tags
        • ShaderLab syntax: Name
        • ShaderLab syntax: BindChannels
      • ShaderLab syntax: UsePass
      • ShaderLab syntax: GrabPass
      • ShaderLab syntax: SubShader Tags
    • ShaderLab syntax: Fallback
  • Writing shader programs
    • Accessing shader properties in Cg
    • Providing vertex data to vertex programs
    • Built-in state variables in shader programs
    • GLSL Shader Programs
  • Advanced ShaderLab topics
    • Unity's Rendering Pipeline
      • Attenuation and shadows for pixel lights
    • Rendering with Replaced Shaders
    • Using Depth Textures
  • ShaderLab builtin values
  • Unity 2.x Shader Conversion Guide
Previous
Next