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.
BIRP apply FinalColor in shader
// 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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment