Skip to content

Commit

Permalink
shaders: Add GLSL port of accum_sun.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Mar 6, 2016
1 parent acecea9 commit 11d9066
Show file tree
Hide file tree
Showing 44 changed files with 1,624 additions and 4 deletions.
Binary file added res/gamedata/shaders/gl/accum_sun.ps
Binary file not shown.
21 changes: 21 additions & 0 deletions res/gamedata/shaders/gl/accum_sun.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "common.h"
#include "iostructs\v_volume.h"

//////////////////////////////////////////////////////////////////////////////////////////
uniform float4x4 m_texgen;
#ifdef USE_SJITTER
uniform float4x4 m_texgen_J;
#endif

//////////////////////////////////////////////////////////////////////////////////////////
// Vertex
v2p_volume _main ( float4 P )
{
v2p_volume O;
O.hpos = mul( m_WVP, P );
O.tc = mul( m_texgen, P );
#ifdef USE_SJITTER
O.tcJ = mul( m_texgen_J, P );
#endif
return O;
}
Binary file added res/gamedata/shaders/gl/accum_sun_far.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_far_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_far_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_mask.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_mask_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_mask_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_near.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_near_msaa.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_near_nomsaa.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_sun_nomsaa.ps
Binary file not shown.
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function normal (shader, t_base, t_second, t_detail)
-- : aref (true,0)
: sorting (2, false)
shader:sampler ("s_lmap") :texture (t_base): clamp()
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_noise") :texture ("fx\\fx_noise") : f_linear ()
end
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_nomsaa.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function normal (shader, t_base, t_second, t_detail)
-- : aref (true,0)
: sorting (2, false)
shader:sampler ("s_lmap") :texture (t_base): clamp()
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_noise") :texture ("fx\\fx_noise") : f_linear ()
end
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_minmax.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa0.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa1.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa2.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa3.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa4.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa5.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa6.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
1 change: 1 addition & 0 deletions res/gamedata/shaders/gl/accum_volumetric_sun_msaa7.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
Expand Down
3 changes: 2 additions & 1 deletion res/gamedata/shaders/gl/accum_volumetric_sun_nomsaa.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_smap_minmax") :texture ("$user$smap_depth_minmax") : comp_less ()
shader:sampler ("s_smap_minmax") :texture ("$user$smap_depth_minmax")
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
3 changes: 2 additions & 1 deletion res/gamedata/shaders/gl/accum_volumetric_sun_nomsaa_minmax.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ function normal (shader, t_base, t_second, t_detail)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
shader:sampler ("s_dmap") :texture ("$user$smap_depth")
shader:sampler ("s_smap") :texture ("$user$smap_depth") : comp_less ()
shader:sampler ("s_smap_minmax") :texture ("$user$smap_depth_minmax") : comp_less ()
shader:sampler ("s_smap_minmax") :texture ("$user$smap_depth_minmax")
shader:sampler ("s_position") :texture ("$user$position")
shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()
end
12 changes: 10 additions & 2 deletions res/gamedata/shaders/gl/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@

#include "shared\common.h"

// TODO: OGL: Move to cbuffers
uniform half4 hemi_cube_pos_faces;
uniform half4 hemi_cube_neg_faces;
uniform half4 L_material; // 0,0,0,mid
uniform half4 Ldynamic_color; // dynamic light color (rgb1) - spot/point
uniform half4 Ldynamic_pos; // dynamic light pos+1/range(w) - spot/point
uniform half4 Ldynamic_dir; // dynamic light direction - sun

#include "common_defines.h"
//include "common_policies.h"
#include "common_policies.h"
#include "common_iostructs.h"
#include "common_samplers.h"
//include "common_cbuffers.h"
//include "common_functions.h"
#include "common_functions.h"

// #define USE_SUPER_SPECULAR

Expand Down
Loading

0 comments on commit 11d9066

Please sign in to comment.