Version: Unity 6.6 (6000.6)
Language : English
Surface Shader examples in the Built-In Render Pipeline
Reflection Surface Shader examples in the Built-In Render Pipeline

Normal mapping Surface Shader example in the Built-In Render Pipeline

Important: The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.

It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.

The Universal Render Pipeline (URP) doesn’t support surface shaders. For more information on how to replace surface shaders in URP, refer to Convert custom shaders for URP compatibility.

Shader example that uses normal mapping.
Shader example that uses normal mapping.
  Shader "Example/Diffuse Bump" {
    Properties {
      _MainTex ("Texture", 2D) = "white" {}
      _BumpMap ("Bumpmap", 2D) = "bump" {}
    }
    SubShader {
      Tags { "RenderType" = "Opaque" }
      CGPROGRAM
      #pragma surface surf Lambert
      struct Input {
        float2 uv_MainTex;
        float2 uv_BumpMap;
      };
      sampler2D _MainTex;
      sampler2D _BumpMap;
      void surf (Input IN, inout SurfaceOutput o) {
        o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
        o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
      }
      ENDCG
    } 
    Fallback "Diffuse"
  }
Surface Shader examples in the Built-In Render Pipeline
Reflection Surface Shader examples in the Built-In Render Pipeline