BlueGit

blue-star ggj-2020

Files

ggj-2020 / Assets / Oculus / VR / Resources / Underlay Transparent Occluder.shader

Underlay Transparent Occluder.shader

Project Import
timfa Tim Falken · pushed by timfa · 6 years ago
b77834a1 History
Underlay Transparent Occluder.shader 968 B Download Raw
1/*
2Code for transparent object in front of the overlay
3The keepalpha option is important to let unity maintain the alpha we return from the shader
4*/
5
6Shader "Oculus/Underlay Transparent Occluder" {
7 Properties{
8 _Color("Main Color", Color) = (1,1,1,1)
9 _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
10 }
11 SubShader{
12 Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
13 Blend SrcAlpha OneMinusSrcAlpha
14
15 // extra pass that renders to depth buffer only
16 Pass{
17 ZWrite On
18 ColorMask 0
19 }
20
21 CGPROGRAM
22 #pragma surface surf Lambert keepalpha
23 fixed4 _Color;
24 struct Input {
25 float4 color : COLOR;
26 };
27 void surf(Input IN, inout SurfaceOutput o) {
28 o.Albedo = _Color.rgb;
29 o.Alpha = _Color.a;
30 }
31 ENDCG
32 }
33
34
35 Fallback "Transparent/VertexLit"
36}