Hello Guys,
I am trying to make an invisible sphere that masks what’s inside it, but through a criteria (perhabs a texture color) I want to disable the invisibility effect
You can think of it as an invisible house that you can’t look at what’s inside except for through it’s windows
This is what I have achieved so far
Shader "Custom/InvisibleMask" {
Properties{
_MainTex("Color (RGB) Alpha (A)", 2D) = "white" {}
}
SubShader{
// draw after all opaque objects (queue = 2001):
Tags{ "Queue" = "Geometry+1" }
Pass{
Blend Zero One
}
CGPROGRAM
#pragma surface surf Standard alpha:fade
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutputStandard o)
{
fixed4 targetColor = tex2D(_MainTex, IN.uv_MainTex);
clip(targetColor.r>0.5);
o.Albedo = float3(0,0,0);
o.Alpha = 0.25;
}
ENDCG
}
}