Created
September 2, 2025 10:25
-
-
Save unitycoder/fc30eac3cd4120d7050aaba38a850fbc to your computer and use it in GitHub Desktop.
BIRP apply FinalColor in shader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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