Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/BasicVCShader" {
- Properties
- {
- _Color("Color", Color) = (1,1,1,1)
- }
- SubShader{
- Pass {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #include "UnityCG.cginc"
- float4 _Color;
- // vertex input: position, color
- struct appdata {
- float4 vertex : POSITION;
- float4 color : COLOR;
- };
- struct v2f {
- float4 pos : SV_POSITION;
- float4 color : COLOR;
- };
- v2f vert(appdata v) {
- v2f o;
- o.pos = UnityObjectToClipPos(v.vertex);
- o.color = v.color;
- return o;
- }
- float4 frag(v2f i) : SV_Target{
- if (i.color.r >= 1.0 && i.color.g >= 1.0 && i.color.b >= 1.0) {
- return _Color;
- }
- return i.color;
- }
- ENDCG
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement