Question by
ogdeliirium · Apr 20, 2019 at 01:28 PM ·
transparent
How do i make it, so it is transparent and not a color? im new to this and this is not my script
Shader "Custom" { Properties {
} SubShader { Tags { "Queue"="Overlay+10" "RenderType"="Overlay" "ForceNoShadowCasting"="True" "IgnoreProjector"="True" "DisableBatching" = "True" } LOD 300 GrabPass{ "_BackgroundTexture" } ZWrite Off ZTest Always Cull Off Blend One Zero
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D GrabPass;
struct appdata
{
float2 uv : TEXCOORD0;
};
struct v2f
{
float3 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = float4(v.uv * 2 - 1, 0, 0);
#ifdef UNITY_UV_STARTS_AT_TOP
v.uv.y = 1-v.uv.y;
#endif
o.uv.xy = UnityStereoTransformScreenSpaceTex(v.uv);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(GrabPass, i.uv.xy);
fixed grey = dot(col.rgb, float3(0, 255, 255));
return grey;
}
ENDCG
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Remove collider from transparent areas 1 Answer
A problem with a shader to make a window transparent 0 Answers
How do I create a Transparent Window example in Linux? 0 Answers
Can unity make the whole window transparent? 0 Answers
Problem Material Renderer Opaque-Transparent,Problem material renderer Opaque-Transparent 0 Answers