Skip to content

Commit 87276b4

Browse files
committed
shaders: Add GLSL port of rain shaders.
1 parent 221062a commit 87276b4

14 files changed

+89
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
out vec4 SV_Target;
3+
#ifdef MSAA_OPTIMIZATION
4+
in int gl_SampleID;
5+
#endif
6+
7+
layout(location = TEXCOORD0) in float2 p_rain_tc ; // TEXCOORD0;
8+
layout(location = TEXCOORD1) in float2 p_rain_tcJ ; // TEXCOORD1;
9+
10+
#ifdef MSAA_OPTIMIZATION
11+
float4 _main ( float2 tc, float2 tcJ, uint iSample );
12+
#else
13+
float4 _main ( float2 tc, float2 tcJ );
14+
#endif
15+
16+
void main()
17+
{
18+
#ifdef MSAA_OPTIMIZATION
19+
SV_Target = _main ( p_rain_tc, p_rain_tcJ, gl_SampleID );
20+
#else
21+
SV_Target = _main ( p_rain_tc, p_rain_tcJ );
22+
#endif
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
out vec4 SV_Target;
3+
#ifdef GBUFFER_OPTIMIZATION
4+
in vec4 gl_FragCoord;
5+
#endif
6+
7+
layout(location = TEXCOORD0) in float2 p_rain_tc ; // TEXCOORD0;
8+
layout(location = TEXCOORD1) in float2 p_rain_tcJ ; // TEXCOORD1;
9+
10+
#ifdef GBUFFER_OPTIMIZATION
11+
float4 _main ( float2 tc, float2 tcJ, float4 pos2d );
12+
#else
13+
float4 _main ( float2 tc, float2 tcJ );
14+
#endif
15+
16+
void main()
17+
{
18+
#ifdef GBUFFER_OPTIMIZATION
19+
SV_Target = _main ( p_rain_tc, p_rain_tcJ, gl_FragCoord );
20+
#else
21+
SV_Target = _main ( p_rain_tc, p_rain_tcJ );
22+
#endif
23+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
out vec4 SV_Target;
3+
#ifdef MSAA_OPTIMIZATION
4+
in int gl_SampleID;
5+
#endif
6+
#ifdef GBUFFER_OPTIMIZATION
7+
in vec4 gl_FragCoord;
8+
#endif
9+
10+
layout(location = TEXCOORD0) in float2 p_rain_tc ; // TEXCOORD0;
11+
layout(location = TEXCOORD1) in float2 p_rain_tcJ ; // TEXCOORD1;
12+
layout(location = COLOR) in float4 p_rain_Color; // COLOR;
13+
14+
#ifdef GBUFFER_OPTIMIZATION
15+
#ifdef MSAA_OPTIMIZATION
16+
float4 _main ( float2 tc, float2 tcJ, float4 Color, float4 pos2d, uint iSample );
17+
#else
18+
float4 _main ( float2 tc, float2 tcJ, float4 Color, float4 pos2d );
19+
#endif
20+
#else
21+
#ifdef MSAA_OPTIMIZATION
22+
float4 _main ( float2 tc, float2 tcJ, uint iSample );
23+
#else
24+
float4 _main ( float2 tc, float2 tcJ );
25+
#endif
26+
#endif
27+
28+
void main()
29+
{
30+
#ifdef GBUFFER_OPTIMIZATION
31+
#ifdef MSAA_OPTIMIZATION
32+
SV_Target = _main ( p_rain_tc, p_rain_tcJ, p_rain_Color, gl_FragCoord, gl_SampleID );
33+
#else
34+
SV_Target = _main ( p_rain_tc, p_rain_tcJ, p_rain_Color, gl_FragCoord );
35+
#endif
36+
#else
37+
#ifdef MSAA_OPTIMIZATION
38+
SV_Target = _main ( p_rain_tc, p_rain_tcJ, gl_SampleID );
39+
#else
40+
SV_Target = _main ( p_rain_tc, p_rain_tcJ );
41+
#endif
42+
#endif
43+
}
1.04 KB
Binary file not shown.
31 Bytes
Binary file not shown.
Binary file not shown.
798 Bytes
Binary file not shown.
31 Bytes
Binary file not shown.
Binary file not shown.

res/gamedata/shaders/gl/rain_layer.ps

1.07 KB
Binary file not shown.

0 commit comments

Comments
 (0)