UnityEngineStandard Surface Shaders2022-10

Written in the Cg programming language for Unity Built-In RP
CgBuilt-in RPShaderLabUnitySurface ShaderLighting
View on GitHub

Implementation

  • Lambert Lighting, Blinn-Phong Lighting and Custom Lighting models.
  • Standard Surface Shaders in Unity using the #pragma directive to define the surface function and the lighting model.
  • Setting the Albedo property from a texture.
  • Normals implemented using a Normal Map or "Bump Map".
  • Fresnel shader implemented doing the dot scalar multiplication between the Normal and the IN.viewDir.
  • Environment Mapping using a SkyBox or Cube Map, then using the Unity provided worldRefl vector to derive the texel using texCUBE.
  • Combine Normal Maps and Environment Mapping, using the Unity provided INTERNAL_DATA macro and the WorldReflectionVector()
  • Using the Binn-Phong lighting model in a Standard Surface Shader.
  • Implementing a Custom Lambert Lighting model.
  • Toon Shading implemented with a ramped Lambert lighting model and an Outline shader implemented in a second Pass.
  • Utilizing the Standard, physically correct lighting model.
  • Writing a custom unlit shader for manual implementation of Lambert Lighting, Ambient Illumination and Shadow Casting/Receiving.