Skip to content

Commit 2c7d7c8

Browse files
Simulation of falling into the abyss.
1 parent 00ded2e commit 2c7d7c8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Diff for: abyss.shader

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Shader "Abyss"
2+
{
3+
Properties
4+
{
5+
_intensity ("Intensity",Float) = 1.0
6+
}
7+
Subshader
8+
{
9+
Pass
10+
{
11+
CGPROGRAM
12+
#pragma vertex vertex_shader
13+
#pragma fragment pixel_shader
14+
#pragma target 3.0
15+
16+
float _intensity;
17+
18+
struct custom_type
19+
{
20+
float4 vertex : SV_POSITION;
21+
float2 uv : TEXCOORD0;
22+
};
23+
24+
custom_type vertex_shader (float4 vertex:POSITION, float2 uv:TEXCOORD0)
25+
{
26+
custom_type vs;
27+
vs.vertex = mul (UNITY_MATRIX_MVP,vertex);
28+
vs.uv = uv;
29+
return vs;
30+
}
31+
32+
float4 pixel_shader (custom_type ps) : COLOR
33+
{
34+
float t = pow(ps.uv.y,_intensity);
35+
return float4(t,t,t,1.0);
36+
}
37+
ENDCG
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)