- Home /
Question by
Twitch375 · Jun 23, 2017 at 12:51 AM ·
texturerenderingtransparent
Transparent Render Texture when nothing is being rendered.
When the camera isn't rendering anything the Render Texture displays whatever the cameras Clear flag is set to. In my case it's set to solid color (RGB and Alpha all set to 0). Is there any way to modify this mask shader to make those solid color areas set by the camera to be transparent? I have very limited shader knowledge but any help is appreciated.
Shader "MaskedTexture" { Properties { _MainTex("Base (RGB)", 2D) = "white" {} _Mask("Culling Mask", 2D) = "white" {} _Cutoff("Alpha cutoff", Range(0,1)) = 0.1 }
SubShader
{
Tags{ "Queue" = "Transparent"}
Lighting Off
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
AlphaTest GEqual[_Cutoff]
Pass
{
SetTexture[_Mask]{ combine texture }
SetTexture[_MainTex]{ combine texture, previous }
}
}
Comment