-
-
Save mikedolan03/b5ac3f6a5f2120c1c7d959fd5a423e28 to your computer and use it in GitHub Desktop.
Unity Shader to visualize vertex color.
This file contains 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
Shader "Custom/VertexColorT" { | |
SubShader{ | |
Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Lambert vertex:vert alpha | |
#pragma target 3.0 | |
struct Input { | |
float4 vertColor; | |
}; | |
void vert(inout appdata_full v, out Input o) { | |
UNITY_INITIALIZE_OUTPUT(Input, o); | |
o.vertColor = v.color; | |
} | |
void surf(Input IN, inout SurfaceOutput o) { | |
o.Albedo = IN.vertColor.rgb; | |
o.Alpha = .5; | |
} | |
ENDCG | |
} | |
FallBack "Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment