Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. Shader "Custom/VertexColors" {
  2.     Properties{
  3.         _Color("Color", Color) = (1,1,1,1)
  4.         _MainTex("Albedo (RGB)", 2D) = "white" {}
  5.         _Glossiness("Smoothness", Range(0,1)) = 0.5
  6.         _Metallic("Metallic", Range(0,1)) = 0.0
  7.     }
  8.         SubShader{
  9.             Tags { "RenderType" = "Opaque" }
  10.             LOD 200
  11.  
  12.             CGPROGRAM
  13.  
  14.             #pragma surface surf Standard fullforwardshadows
  15.             #pragma target 3.0
  16.  
  17.             sampler2D _MainTex;
  18.  
  19.             struct Input {
  20.                 float2 uv_MainTex;
  21.                 float4 vertColor : COLOR;
  22.             };
  23.  
  24.             half _Glossiness;
  25.             half _Metallic;
  26.             fixed4 _Color;
  27.  
  28.             void surf(Input IN, inout SurfaceOutputStandard o) {
  29.                 fixed4 c = IN.vertColor;
  30.                 o.Albedo = c.rgb;
  31.                 if (c.r == 1.0 && c.g == 1.0 && c.b == 1.0) {
  32.                     o.Albedo = _Color.rgb;
  33.                 }
  34.                 o.Metallic = _Metallic;
  35.                 o.Smoothness = _Glossiness;
  36.                 o.Alpha = c.a;
  37.             }
  38.             ENDCG
  39.         }
  40.             FallBack "Diffuse"
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement