-
-
Save kkolyan/f1c603c1a8b935e81d580d4a4692d056 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 "Unlit/Color Alpha Two-Sided" { | |
Properties { | |
_Color ("Main Color (A=Opacity)", Color) = (1,1,1,1) | |
_VTex ("Vertical Texture", 2D) = "white" | |
_HTex ("Horizontal Texture", 2D) = "white" | |
} | |
Category { | |
Tags {"Queue"="Transparent" "IgnoreProjector"="True"} | |
ZWrite Off | |
Blend SrcAlpha OneMinusSrcAlpha | |
SubShader { | |
CGINCLUDE | |
struct Input { | |
float2 uv_VTex; | |
float3 worldPos; | |
float3 worldNormal; | |
}; | |
sampler2D _VTex; | |
sampler2D _HTex; | |
fixed4 _Color; | |
#pragma surface surf Lambert alpha noshadow finalcolor:color | |
void surf (Input IN, inout SurfaceOutput o) { | |
} | |
void color(Input IN, SurfaceOutput o, inout fixed4 color) | |
{ | |
float3 norm = IN.worldNormal; | |
if (norm.y > 0 || norm.y < 0) { | |
color = tex2D (_HTex, IN.uv_VTex/*UV's of H and V area the same*/) * _Color; | |
} else { | |
color = tex2D (_VTex, IN.uv_VTex) * _Color; | |
} | |
} | |
ENDCG | |
Cull Front | |
CGPROGRAM | |
ENDCG | |
Cull Back | |
CGPROGRAM | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment