Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate new shaders into r5 #1545

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 3 additions & 10 deletions res/gamedata/shaders/r3/common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,12 @@
#define def_hdr float(9.h) // hight luminance range float(3.h)
#define def_hdr_clip float(0.75h) //

#define LUMINANCE_VECTOR float3(0.3f, 0.38f, 0.22f)

//////////////////////////////////////////////////////////////////////////////////////////
#ifndef SMAP_size
#define SMAP_size 2048
#define SMAP_size 1024
#endif
//////////////////////////////////////////////////////////////////////////////////////////

#define SKY_DEPTH float(10000.0)
#define SKY_EPS float(0.001)
#define FARPLANE float(180.0)

#define USABLE_BIT_13 uint(0x02000000) // This will be translated to a +/-MAX_FLOAT in the FP16 render target (0xFBFF/0x7BFF), overwriting the
#define USABLE_BIT_14 uint(0x04000000) // mantissa bits where other bit flags are stored.
#define USABLE_BIT_15 uint(0x80000000)
#define MUST_BE_SET uint(0x40000000) // This flag *must* be stored in the floating-point representation of the bit flag to store

#endif // common_defines_h_included
Binary file modified res/gamedata/shaders/r3/rain_patch_normal_new.ps
Binary file not shown.
11 changes: 3 additions & 8 deletions res/gamedata/shaders/r3/shared/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// All comments by Nivenhbro are preceded by !
/////////////////////////////////////////////////


#ifndef SHARED_COMMON_H
#define SHARED_COMMON_H

Expand All @@ -26,7 +27,6 @@ cbuffer shader_params
cbuffer static_globals
{
uniform float3x4 m_V;
uniform float3x4 m_inv_V;
uniform float4x4 m_P;
uniform float4x4 m_VP;

Expand All @@ -40,20 +40,14 @@ cbuffer static_globals
uniform float3 L_sun_color;
uniform float3 L_sun_dir_w;
uniform float4 L_hemi_color;
uniform float4 Ldynamic_dir;
uniform float4 Ldynamic_pos;
uniform float4 Ldynamic_color;

uniform float3 eye_position;

uniform float4 pos_decompression_params;
uniform float4 pos_decompression_params2;

uniform float4 parallax;
uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution)
uniform float4 rain_params; //x = raindensity, y = wetness
uniform float4 pp_img_corrections;
uniform float4 pp_img_cg;
// uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution)
}

/*
Expand Down Expand Up @@ -87,4 +81,5 @@ float2 calc_xz_wave (float2 dir2D, float frac)
return lerp (ctrl_A, ctrl_B, frac); //!This calculates tree wave. No changes made
}


#endif
Binary file modified res/gamedata/shaders/r3/ssao.ps
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added res/gamedata/shaders/r5/accum_indirect_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_indirect_nomsaa.ps
Binary file not shown.
7 changes: 7 additions & 0 deletions res/gamedata/shaders/r5/accum_mask.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "common.h"

float4 main ( float4 P: POSITION ) : SV_Position
{
return mul ( m_WVP, P );
}
FXVS;
Binary file added res/gamedata/shaders/r5/accum_omni_normal.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_omni_normal_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_omni_normal_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_omni_transluent.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_spot_fullsize.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_spot_fullsize_msaa.ps
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_spot_normal.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_spot_normal_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_spot_normal_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_spot_unshadowed.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions res/gamedata/shaders/r5/accum_sun.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "common.h"

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

//////////////////////////////////////////////////////////////////////////////////////////
// Vertex
v2p_volume main ( float4 P: POSITION )
{
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;
}
FXVS;
Binary file added res/gamedata/shaders/r5/accum_sun_far_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_far_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_mask.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_mask_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_mask_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_near_msaa.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_near_nomsaa.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_near_old.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_sun_nomsaa.ps
Binary file not shown.
21 changes: 21 additions & 0 deletions res/gamedata/shaders/r5/accum_volume.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "common.h"

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

//////////////////////////////////////////////////////////////////////////////////////////
// Vertex
v2p_volume main ( float4 P: POSITION )
{
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;
}
FXVS;
21 changes: 21 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_volumetric", "accum_volumetric")
: fog (false)
: zb (true,false)
: blend (true,blend.one,blend.one)
-- : aref (true,0)
: sorting (2, false)
-- TODO: Implement sampler states
-- shader:sampler ("s_lmap") :texture (t_base): clamp()
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_noise") :texture("fx\\fx_noise") : f_linear ()

shader:dx10texture ("s_lmap", t_base)
shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_noise", "fx\\fx_noise")

shader:dx10sampler ("smp_rtlinear")
shader:dx10sampler ("smp_linear")
-- shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
44 changes: 44 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "common.h"

cbuffer VolumetricLights
{
float3 vMinBounds;
float3 vMaxBounds;
float4 FrustumClipPlane[6];
}

struct v2p
{
float3 lightToPos : TEXCOORD0; // light center to plane vector
float3 vPos : TEXCOORD1; // position in camera space
float fDensity : TEXCOORD2; // plane density alon Z axis
// float2 tNoise : TEXCOORD3; // projective noise
float3 clip0 : SV_ClipDistance0;
float3 clip1 : SV_ClipDistance1;
float4 hpos : SV_Position;
};

v2p main ( float3 P : POSITION )
{
v2p o;
float4 vPos;
vPos.xyz = lerp( vMinBounds, vMaxBounds, P); // Position in camera space
vPos.w = 1;
o.hpos = mul (m_P, vPos); // xform, input in camera coordinates

o.lightToPos = vPos.xyz - Ldynamic_pos.xyz;
o.vPos = vPos;

// o.fDensity = (vMaxBounds.z-vMinBounds.z)/2000.0h;
// o.fDensity = (vMaxBounds.z-vMinBounds.z)/2000.0h*2;
o.fDensity = 1.0h/40.0h;
// o.fDensity = 1.0h/20.0h;

for (int i=0; i<3; ++i)
{
o.clip0[i] = dot( o.hpos, FrustumClipPlane[i]);
o.clip1[i] = dot( o.hpos, FrustumClipPlane[i+3]);
}

return o;
}
Binary file added res/gamedata/shaders/r5/accum_volumetric_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/r5/accum_volumetric_nomsaa.ps
Binary file not shown.
21 changes: 21 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_nomsaa.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_volumetric", "accum_volumetric")
: fog (false)
: zb (true,false)
: blend (true,blend.one,blend.one)
-- : aref (true,0)
: sorting (2, false)
-- TODO: Implement sampler states
-- shader:sampler ("s_lmap") :texture (t_base): clamp()
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_noise") :texture("fx\\fx_noise") : f_linear ()

shader:dx10texture ("s_lmap", t_base)
shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_noise", "fx\\fx_noise")

shader:dx10sampler ("smp_rtlinear")
shader:dx10sampler ("smp_linear")
-- shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
1 change: 1 addition & 0 deletions res/gamedata/shaders/r5/accum_volumetric_nomsaa.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "accum_volumetric.vs"
21 changes: 21 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("stub_notransform_2uv", "accum_volumetric_sun_normal")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_smap_minmax", "$user$smap_depth_minmax");
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
21 changes: 21 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_minmax.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_minmax")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_smap_minmax", "$user$smap_depth_minmax");
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_msaa0.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_msaa0")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
20 changes: 20 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_msaa1.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_msaa1")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
20 changes: 20 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_msaa2.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_msaa2")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
20 changes: 20 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_msaa3.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_msaa3")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
20 changes: 20 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_msaa4.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_msaa4")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
20 changes: 20 additions & 0 deletions res/gamedata/shaders/r5/accum_volumetric_sun_msaa5.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function normal (shader, t_base, t_second, t_detail)
shader:begin ("accum_sun", "accum_volumetric_sun_msaa5")
: fog (false)
: zb (false,false)
: blend (true,blend.one,blend.one)
: sorting (2, false)
-- TODO: DX10: Implement for near and far phase.
-- TODO: DX10: Setup samplers.
-- shader:sampler ("s_smap") :texture ("null")
-- shader:sampler ("s_position") :texture ("$user$position")
-- shader:sampler ("jitter0") :texture ("$user$jitter_0") : f_none ()

shader:dx10texture ("s_smap", "null")
shader:dx10texture ("s_position", "$user$position")
shader:dx10texture ("jitter0", "$user$jitter_0")

shader:dx10sampler ("smp_nofilter")
shader:dx10sampler ("smp_jitter")
shader:dx10sampler ("smp_smap")
end
Binary file not shown.
Loading