Skip to content

Commit 43445e5

Browse files
committed
GLSL shaders fixes
MSAA and HBAO is broken And level fog is... yellow
1 parent 137605d commit 43445e5

File tree

15 files changed

+7
-7
lines changed

15 files changed

+7
-7
lines changed
16 Bytes
Binary file not shown.
-3 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.

res/gamedata/shaders/gl/common_functions.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ gbuffer_data gbuffer_load_data( float2 tc, float4 pos2d, uint iSample )
239239
#ifndef USE_MSAA
240240
float4 P = tex2D( s_position, tc );
241241
#else
242-
float4 P = texelFetch( s_position, int2( pos2d ), 0, iSample );
242+
float4 P = texelFetch( s_position, int2( pos2d ), int(iSample) );
243243
#endif
244244

245245
// 3d view space pos reconstruction math
@@ -264,7 +264,7 @@ gbuffer_data gbuffer_load_data( float2 tc, float4 pos2d, uint iSample )
264264
#ifndef USE_MSAA
265265
float4 C = tex2D( s_diffuse, tc );
266266
#else
267-
float4 C = texelFetch( s_diffuse, int2( pos2d ), 0, iSample );
267+
float4 C = texelFetch( s_diffuse, int2( pos2d ), int(iSample) );
268268
#endif
269269

270270
gbd.C = C.xyz;
@@ -300,7 +300,7 @@ gbuffer_data gbuffer_load_data( float2 tc, uint iSample )
300300
#ifndef USE_MSAA
301301
float4 P = tex2D( s_position, tc );
302302
#else
303-
float4 P = texelFetch( s_position, int2( tc * pos_decompression_params2.xy ), 0, iSample );
303+
float4 P = texelFetch( s_position, int2( tc * pos_decompression_params2.xy ), int(iSample) );
304304
#endif
305305

306306
gbd.P = P.xyz;
@@ -309,7 +309,7 @@ gbuffer_data gbuffer_load_data( float2 tc, uint iSample )
309309
#ifndef USE_MSAA
310310
float4 N = tex2D( s_normal, tc );
311311
#else
312-
float4 N = texelFetch( s_normal, int2( tc * pos_decompression_params2.xy ), 0, iSample );
312+
float4 N = texelFetch( s_normal, int2( tc * pos_decompression_params2.xy ), int(iSample) );
313313
#endif
314314

315315
gbd.N = N.xyz;
@@ -318,7 +318,7 @@ gbuffer_data gbuffer_load_data( float2 tc, uint iSample )
318318
#ifndef USE_MSAA
319319
float4 C = tex2D( s_diffuse, tc );
320320
#else
321-
float4 C = texelFetch( s_diffuse, int2( tc * pos_decompression_params2.xy ), 0, iSample );
321+
float4 C = texelFetch( s_diffuse, int2( tc * pos_decompression_params2.xy ), int(iSample) );
322322
#endif
323323

324324

res/gamedata/shaders/gl/copy.ps

-6 Bytes
Binary file not shown.

res/gamedata/shaders/gl/copy_p.ps

24 Bytes
Binary file not shown.

res/gamedata/shaders/gl/dof.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ float3 dof(float2 center)
3939
#ifndef USE_MSAA
4040
float depth = tex2D(s_position,center).z;
4141
#else
42-
float depth = texelFetch(s_position, int2( center * pos_decompression_params2.xy ), 0, 0).z;
42+
float depth = texelFetch(s_position, int2( center * pos_decompression_params2.xy ), 0).z;
4343
#endif
4444
if (depth <= EPSDEPTHDOF) depth = dof_params.w;
4545
float blur = DOFFactor(depth);
@@ -79,7 +79,7 @@ float3 dof(float2 center)
7979
#ifndef USE_MSAA
8080
float tap_depth = tex2D (s_position,tap).z;
8181
#else
82-
float tap_depth = texelFetch(s_position, int2( tap* pos_decompression_params2.xy ), 0, 0).z;
82+
float tap_depth = texelFetch(s_position, int2( tap* pos_decompression_params2.xy ), 0).z;
8383
#endif
8484
if (tap_depth <= EPSDEPTHDOF) tap_depth = dof_params.w;
8585
float tap_contrib = DOFFactor(tap_depth);
11 Bytes
Binary file not shown.
27 Bytes
Binary file not shown.

res/gamedata/shaders/gl/ssao.ps

1 Byte
Binary file not shown.

0 commit comments

Comments
 (0)