So I have this rather simple surface shader that essentially cuts a hole in the object based on another texture.
Shader "Custom/NewSurfaceShader" {
Properties {
_MainTex("Texture (RGB)", 2D) = "white" {}
_SliceGuide("Slice Guide (RGB)", 2D) = "white" {}
_SliceAmount("Slice Amount", Range(0.0, 1.0)) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
Cull OFF
CGPROGRAM
#pragma surface surf Lambert addshadow
struct Input {
float2 uv_MainTex;
float2 uv_SliceGuide;
float _SliceAmount;
};
sampler2D _MainTex;
sampler2D _SliceGuide;
float _SliceAmount;
void surf(Input IN, inout SurfaceOutput o) {
clip(tex2D(_SliceGuide, IN.uv_SliceGuide).rgb - _SliceAmount);
o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb;
}
ENDCG
}
Fallback "Diffuse"
}
This produces the following effect.
Now as cool as this looks I want to only apply it to, let's say, one side of the cube and its opposite side. Any suggestions on how do I go about doing this will be appreciated.