Surface Shader required directives reference for the Built-In Render Pipeline
Reference for the surface shader code and lighting model directives in a Surface Shader.
Read time 1 minuteLast updated 2 months ago
-
- which Cg function has surface shader code. The function should have the form of
surfaceFunction, where Input is a structure you have defined. Input should contain any texture coordinates and extra automatic variables needed by surface function.void surf (Input IN, inout SurfaceOutput o) -
- lighting model to use. Built-in ones are physically based
lightModelandStandard, as well as simple non-physically basedStandardSpecular(diffuse) andLambert(specular). See Custom Lighting Models page for how to write your own.BlinnPhong- lighting model uses
Standardoutput struct, and matches the Standard (metallic workflow) shader in Unity.SurfaceOutputStandard - lighting model uses
StandardSpecularoutput struct, and matches the Standard (specular setup) shader in Unity.SurfaceOutputStandardSpecular - and
Lambertlighting models are not physically based (coming from Unity 4.x), but the shaders using them can be faster to render on low-end hardware.BlinnPhong