Created
January 15, 2018 18:39
-
-
Save jhorikawa/7a236ae0b801bf2aca2d8a3038b9bf40 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/VertexColor" { | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Lambert vertex:vert | |
#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; | |
} | |
ENDCG | |
} | |
FallBack "Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok!
I solved the bug. I tweaked Maya baking and fixed the bug!
Your shader working well!!!
(The gamma is different)