Created
January 18, 2017 22:03
-
-
Save Stektpotet/81a9dd68c09b2675e5e702cb8c4bfa64 to your computer and use it in GitHub Desktop.
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/StandardVertex" { | |
Properties { | |
_Color ("ColorTint", Color) = (1,1,1) | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
_Metallic ("Metallic", Range(0,1)) = 0.0 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Standard vertex:vert fullforwardshadows | |
#pragma target 3.0 | |
struct Input { | |
float4 vertexColor; // Vertex color | |
}; | |
void vert (inout appdata_full v, out Input o) | |
{ | |
UNITY_INITIALIZE_OUTPUT(Input,o); | |
o.vertexColor = v.color; // Save the Vertex Color in the Input for the surf() method | |
} | |
fixed3 _Color; | |
half _Glossiness; | |
half _Metallic; | |
void surf (Input IN, inout SurfaceOutputStandard o) | |
{ | |
o.Albedo = _Color.rgb * IN.vertexColor; // Combine normal color with the vertex color | |
// Metallic and smoothness come from slider variables | |
o.Metallic = _Metallic; | |
o.Smoothness = _Glossiness; | |
} | |
ENDCG | |
} | |
FallBack "Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment