Skip to content

Commit

Permalink
OpenGL: some changes in shaders for ATI video cards #2
Browse files Browse the repository at this point in the history
Added info about OpenGL version
  • Loading branch information
SkyLoaderr committed Nov 30, 2018
1 parent 23e9a2c commit cf1329d
Show file tree
Hide file tree
Showing 31 changed files with 125 additions and 124 deletions.
Binary file modified res/gamedata/shaders/gl/accum_emissive.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_emissivel.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_indirect.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_omni_unshadowed.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_sun.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/combine_2_naa.ps
Binary file not shown.
8 changes: 4 additions & 4 deletions res/gamedata/shaders/gl/common_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ float get_sun( float4 lmh)

float3 v_hemi(float3 n)
{
return L_hemi_color.rgb*(.5f + .5f*n.y);
return L_hemi_color.rgb*(0.5 + 0.5*n.y);
}

float3 v_sun(float3 n)
Expand Down Expand Up @@ -155,8 +155,8 @@ float2 gbuf_pack_normal( float3 norm )
float2 res;

res.x = norm.z;
res.y = 0.5f * ( norm.x + 1.0f ) ;
res.y *= ( norm.y < 0.0f ? -1.0f : 1.0f );
res.y = 0.5 * ( norm.x + 1.0 ) ;
res.y *= ( norm.y < 0.0 ? -1.0 : 1.0 );

return res;
}
Expand All @@ -166,7 +166,7 @@ float3 gbuf_unpack_normal( float2 norm )
float3 res;

res.z = norm.x;
res.x = ( 2.0f * abs( norm.y ) ) - 1.0f;
res.x = ( 2.0 * abs( norm.y ) ) - 1.0;
res.y = ( norm.y < 0 ? -1.0 : 1.0 ) * sqrt( abs( 1 - res.x * res.x - res.z * res.z ) );

return res;
Expand Down
2 changes: 1 addition & 1 deletion res/gamedata/shaders/gl/deffer_detail_s_flat.vs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ v2p_flat _main (v_detail v)
// Normal in world coords
float3 norm;
norm.x = pos.x - m0.w ;
norm.y = pos.y - m1.w + .75f; // avoid zero
norm.y = pos.y - m1.w + 0.75; // avoid zero
norm.z = pos.z - m2.w ;

// Final out
Expand Down
2 changes: 1 addition & 1 deletion res/gamedata/shaders/gl/deffer_detail_w_flat.vs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ v2p_flat _main (v_detail v)
// Normal in world coords
float3 norm; // = float3(0,1,0);
norm.x = pos.x - m0.w ;
norm.y = pos.y - m1.w + .75f; // avoid zero
norm.y = pos.y - m1.w + 0.75; // avoid zero
norm.z = pos.z - m2.w ;

// Final out
Expand Down
Binary file modified res/gamedata/shaders/gl/distort.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/fxaa_main.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/gather.ps
Binary file not shown.
10 changes: 5 additions & 5 deletions res/gamedata/shaders/gl/hud_crosshair.vs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ v2p_TL0uv _main ( v_TL0uv I )
v2p_TL0uv O;

{
I.P.xy += 0.5f;
// O.HPos.x = I.P.x/1024 * 2 - 1;
// O.HPos.y = (I.P.y/768 * 2 - 1)*-1;
O.HPos.x = I.P.x * screen_res.z * 2 - 1;
O.HPos.y = (I.P.y * screen_res.w * 2 - 1)*-1;
I.P.xy += 0.5;
// O.HPos.x = I.P.x/1024.0 * 2.0 - 1.0;
// O.HPos.y = (I.P.y/768.0 * 2.0 - 1.0) * -1.0;
O.HPos.x = I.P.x * screen_res.z * 2.0 - 1.0;
O.HPos.y = (I.P.y * screen_res.w * 2.0 - 1.0) * -1.0;
O.HPos.zw = I.P.zw;
}

Expand Down
Binary file modified res/gamedata/shaders/gl/lod.ps
Binary file not shown.
6 changes: 3 additions & 3 deletions res/gamedata/shaders/gl/lod.vs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "common.h"
#include "iostructs\v_lod.h"

#define L_SCALE (2.0f*1.55f)
#define L_SCALE (2.0*1.55)
v2p _main ( v_lod I )
{
v2p o;
Expand All @@ -12,7 +12,7 @@ v2p _main ( v_lod I )

// lerp pos
float factor = I.sun_af.w;
float4 pos = float4 (lerp(I.pos0,I.pos1,factor), 1.f);
float4 pos = float4 (lerp(I.pos0,I.pos1,factor), 1.0);

float h = lerp (I.rgbh0.w,I.rgbh1.w,factor)*L_SCALE;

Expand All @@ -24,7 +24,7 @@ v2p _main ( v_lod I )
o.tc1 = I.tc1;

// calc normal & lighting
o.af = float4 (h,h,I.sun_af.z,factor);
o.af = float4 (h, h, I.sun_af.z, factor);
return o;
}

2 changes: 1 addition & 1 deletion res/gamedata/shaders/gl/model_distort4glass.vs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vf _main (v_model v)
// calculate fade
float3 dir_v = normalize (mul(m_WV,v.P));
float3 norm_v = normalize (mul(m_WV,v.N));
float fade = 0.9f*abs (dot(dir_v,norm_v));
float fade = 0.9*abs (dot(dir_v,norm_v));
o.c0 = float4 (fade);

return o;
Expand Down
Binary file modified res/gamedata/shaders/gl/particle.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/postprocess.ps
Binary file not shown.
Loading

0 comments on commit cf1329d

Please sign in to comment.