-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathSEGIRenderSunDepth.shader
70 lines (49 loc) · 1.1 KB
/
SEGIRenderSunDepth.shader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Shader "Hidden/SEGIRenderSunDepth" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Cutoff ("Alpha Cutoff", Range(0,1)) = 0.333
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 5.0
#include "UnityCG.cginc"
sampler2D _MainTex;
float4 _MainTex_ST;
fixed4 _Color;
float _Cutoff;
struct v2f
{
float4 pos : SV_POSITION;
float4 uv : TEXCOORD0;
float3 normal : TEXCOORD1;
half4 color : COLOR;
};
v2f vert (appdata_full v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
float3 pos = o.pos;
o.pos.xy = (o.pos.xy);
o.uv = float4(TRANSFORM_TEX(v.texcoord.xy, _MainTex), 1.0, 1.0);
o.normal = UnityObjectToWorldNormal(v.normal);
o.color = v.color;
return o;
}
sampler2D GILightCookie;
float4x4 GIProjection;
float4 frag (v2f input) : SV_Target
{
float depth = input.pos.z;
return depth;
}
ENDCG
}
}
Fallback "Legacy Shaders/VertexLit"
}