Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created September 2, 2025 10:25
Show Gist options
  • Save unitycoder/fc30eac3cd4120d7050aaba38a850fbc to your computer and use it in GitHub Desktop.
Save unitycoder/fc30eac3cd4120d7050aaba38a850fbc to your computer and use it in GitHub Desktop.

Revisions

  1. unitycoder created this gist Sep 2, 2025.
    26 changes: 26 additions & 0 deletions Tint Final Color.shader
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    // https://docs.unity3d.com/6000.2/Documentation/Manual/SL-SurfaceShaderExamples-FinalColor.html
    Shader "Example/Tint Final Color" {
    Properties {
    _MainTex ("Texture", 2D) = "white" {}
    _ColorTint ("Tint", Color) = (1.0, 0.6, 0.6, 1.0)
    }
    SubShader {
    Tags { "RenderType" = "Opaque" }
    CGPROGRAM
    #pragma surface surf Lambert finalcolor:mycolor
    struct Input {
    float2 uv_MainTex;
    };
    fixed4 _ColorTint;
    void mycolor (Input IN, SurfaceOutput o, inout fixed4 color)
    {
    color *= _ColorTint;
    }
    sampler2D _MainTex;
    void surf (Input IN, inout SurfaceOutput o) {
    o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
    }
    ENDCG
    }
    Fallback "Diffuse"
    }