Skip to content
Binary file modified res/gamedata/shaders/gl/accum_sun_far.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_sun_far_msaa.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_volumetric_sun_msaa0.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/copy.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/copy_p.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/depth_downs.ps
Binary file not shown.
6 changes: 0 additions & 6 deletions res/gamedata/shaders/gl/iostructs/p_aa_aa_sun.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif

layout(location = TEXCOORD0) in float2 p_aa_AA_sun_tc ; // TEXCOORD0;
layout(location = TEXCOORD1) in float2 p_aa_AA_sun_unused ; // TEXCOORD1;
Expand Down
6 changes: 0 additions & 6 deletions res/gamedata/shaders/gl/iostructs/p_accum.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif

layout(location = TEXCOORD0) in float4 p_accum_omni_tc ; // TEXCOORD0;

Expand Down
8 changes: 1 addition & 7 deletions res/gamedata/shaders/gl/iostructs/p_bumped.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ out vec4 SV_Target1;
#ifndef GBUFFER_OPTIMIZATION
out vec4 SV_Target2;
#endif
#ifdef EXTEND_F_DEFFER
out int gl_SampleMask[];
#endif
#ifdef MSAA_ALPHATEST_DX10_1_ATOC
in vec4 gl_FragCoord;
#endif

#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
layout(location = TEXCOORD0) in float4 p_bumped_tcdh ; // TEXCOORD0; // Texture coordinates, w=sun_occlusion
Expand Down Expand Up @@ -62,6 +56,6 @@ void main()
SV_Target2 = O.C;
#endif
#ifdef EXTEND_F_DEFFER
gl_SampleMask[0] = O.mask;
gl_SampleMask[0] = int(O.mask);
#endif
}
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/p_combine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ out vec4 SV_Target0;
out vec4 SV_Target1;
in vec4 gl_FragCoord;

#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif

struct _input
{
#ifdef USE_VTF
Expand Down
1 change: 0 additions & 1 deletion res/gamedata/shaders/gl/iostructs/p_dumb.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

out vec4 SV_Target;

float4 _main ();
Expand Down
8 changes: 1 addition & 7 deletions res/gamedata/shaders/gl/iostructs/p_flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ out vec4 SV_Target1;
#ifndef GBUFFER_OPTIMIZATION
out vec4 SV_Target2;
#endif
#ifdef EXTEND_F_DEFFER
out int gl_SampleMask[];
#endif
#ifdef MSAA_ALPHATEST_DX10_1_ATOC
in vec4 gl_FragCoord;
#endif

#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
layout(location = TEXCOORD0) in float4 p_flat_tcdh ; // TEXCOORD0; // Texture coordinates, w=sun_occlusion
Expand Down Expand Up @@ -58,6 +52,6 @@ void main()
SV_Target2 = O.C;
#endif
#ifdef EXTEND_F_DEFFER
gl_SampleMask[0] = O.mask;
gl_SampleMask[0] = int(O.mask);
#endif
}
11 changes: 2 additions & 9 deletions res/gamedata/shaders/gl/iostructs/p_lod.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ out vec4 SV_Target1;
#ifndef GBUFFER_OPTIMIZATION
out vec4 SV_Target2;
#endif // GBUFFER_OPTIMIZATION
#ifdef EXTEND_F_DEFFER
out int gl_SampleMask[];
#endif // EXTEND_F_DEFFER
#ifdef MSAA_ALPHATEST_DX10_1_ATOC
in vec4 gl_FragCoord;
#endif // MSAA_ALPHATEST_DX10_1_ATOC
#endif // #endif
#endif // #endif

struct v2p
{
Expand Down Expand Up @@ -52,7 +46,6 @@ void main()
#else
f_deffer O = _main (I);
#endif // MSAA_ALPHATEST_DX10_1_ATOC

#endif // ATOC

SV_Target0 = O.position;
Expand All @@ -63,6 +56,6 @@ void main()
SV_Target2 = O.C;
#endif // GBUFFER_OPTIMIZATION
#ifdef EXTEND_F_DEFFER
gl_SampleMask[0] = O.mask;
gl_SampleMask[0] = int(O.mask);
#endif
}
6 changes: 0 additions & 6 deletions res/gamedata/shaders/gl/iostructs/p_naa_aa_combine.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif // GBUFFER_OPTIMIZATION
#ifdef USE_MSAA
out float gl_FragDepth;
#endif

struct c2_out
{
Expand Down
13 changes: 2 additions & 11 deletions res/gamedata/shaders/gl/iostructs/p_particle_deffer.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@

out vec4 SV_Target0;
out vec4 SV_Target1;
#ifndef GBUFFER_OPTIMIZATION
out vec4 SV_Target2;
#endif
#ifdef EXTEND_F_DEFFER
out int gl_SampleMask[];
#endif
#ifdef MSAA_ALPHATEST_DX10_1_ATOC
in vec4 gl_FragCoord;
#endif

struct p_particle
{
Expand All @@ -33,7 +24,7 @@ layout(location = TEXCOORD4) in float2 p_flat_lmh ; // TEXCOORD4; // lm-hemi
#endif

#ifdef MSAA_ALPHATEST_DX10_1_ATOC
f_deffer _main ( p_particle II, float4 pos2d );
f_deffer _main ( p_particle II, float2 pos2d );
#else // MSAA_ALPHATEST_DX10_1_ATOC
f_deffer _main ( p_particle II );
#endif // MSAA_ALPHATEST_DX10_1_ATOC
Expand Down Expand Up @@ -66,6 +57,6 @@ void main()
SV_Target2 = O.C;
#endif
#ifdef EXTEND_F_DEFFER
gl_SampleMask[0] = O.mask;
gl_SampleMask[0] = int(O.mask);
#endif
}
5 changes: 1 addition & 4 deletions res/gamedata/shaders/gl/iostructs/p_rain_apply.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@

out vec4 SV_Target;
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif

layout(location = TEXCOORD0) in float2 p_rain_tc ; // TEXCOORD0;
layout(location = TEXCOORD1) in float2 p_rain_tcJ ; // TEXCOORD1;

#ifdef MSAA_OPTIMIZATION
float4 _main ( float2 tc, float2 tcJ, uint iSample );
float4 _main ( float2 tc, float2 tcJ, int iSample );
#else
float4 _main ( float2 tc, float2 tcJ );
#endif
Expand Down
8 changes: 1 addition & 7 deletions res/gamedata/shaders/gl/iostructs/p_rain_patch.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif

layout(location = TEXCOORD0) in float2 p_rain_tc ; // TEXCOORD0;
layout(location = TEXCOORD1) in float2 p_rain_tcJ ; // TEXCOORD1;
Expand All @@ -19,7 +13,7 @@ float4 _main ( float2 tc, float2 tcJ, float4 Color, float4 pos2d );
#endif
#else
#ifdef MSAA_OPTIMIZATION
float4 _main ( float2 tc, float2 tcJ, uint iSample );
float4 _main ( float2 tc, float2 tcJ, int iSample );
#else
float4 _main ( float2 tc, float2 tcJ );
#endif
Expand Down
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/p_ssao_calc.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
out vec4 SV_Target;
in vec4 gl_FragCoord;

#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif

struct _input
{
#ifdef USE_VTF
Expand Down
6 changes: 0 additions & 6 deletions res/gamedata/shaders/gl/iostructs/p_tl_sun.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif

layout(location = TEXCOORD0) in float2 p_TL_Tex0 ; // TEXCOORD0;
layout(location = COLOR) in float4 p_TL_Color ; // COLOR;
Expand Down
6 changes: 0 additions & 6 deletions res/gamedata/shaders/gl/iostructs/p_volume.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif

layout(location = TEXCOORD0) in float4 p_volume_tc ; // TEXCOORD0;
#ifdef USE_SJITTER
Expand Down
6 changes: 0 additions & 6 deletions res/gamedata/shaders/gl/iostructs/p_volume_sun.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

out vec4 SV_Target;
#ifdef GBUFFER_OPTIMIZATION
in vec4 gl_FragCoord;
#endif // GBUFFER_OPTIMIZATION
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif // MSAA_OPTIMIZATION

layout(location = TEXCOORD0) in float4 p_volume_tc; // TEXCOORD0;
#ifdef USE_SJITTER
Expand Down
4 changes: 1 addition & 3 deletions res/gamedata/shaders/gl/iostructs/p_volumetric.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

out vec4 SV_Target;
#ifdef MSAA_OPTIMIZATION
in int gl_SampleID;
#endif


struct v2p
{
Expand Down
Binary file modified res/gamedata/shaders/gl/mark_msaa_edges.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/rain_apply_gloss.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/rain_apply_normal.ps
Binary file not shown.
7 changes: 3 additions & 4 deletions res/gamedata/shaders/gl/shadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,12 @@ bool cheap_reject( float3 tc, inout bool full_light )
float4 plane1 = sm_minmax_gather( tc.xy, int2( 1,-1 ) );
float4 plane2 = sm_minmax_gather( tc.xy, int2( -1, 1 ) );
float4 plane3 = sm_minmax_gather( tc.xy, int2( 1, 1 ) );
bool plane = all( greaterThanEqual( plane0, float4(0.0) )) && all(greaterThanEqual( plane1, float4(0.0) )) && all(greaterThanEqual( plane2, float4(0.0) )) && all(greaterThanEqual( plane3, float4(0.0) ) );

bool plane = all(greaterThanEqual( plane0, float4(0.0) )) && all(greaterThanEqual( plane1, float4(0.0) )) && all(greaterThanEqual( plane2, float4(0.0) )) && all(greaterThanEqual( plane3, float4(0.0) ));
if( !plane ) // if there are no proper plane equations in the support region
{
bool no_plane = all(lessThan( plane0, float4(0.0) )) && all(lessThan( plane1, float4(0.0) )) && all(lessThan( plane2, float4(0.0) )) && all(lessThan( plane3, float4(0.0) ) );
bool no_plane = all(lessThan( plane0, float4(0.0) )) && all(lessThan( plane1, float4(0.0) )) && all(lessThan( plane2, float4(0.0) )) && all(lessThan( plane3, float4(0.0) ));
float4 z = float4( tc.z - 0.0005 );
bool reject = all( greaterThan( z, -plane0 )) && all(greaterThan( z, -plane1 )) && all(greaterThan( z, -plane2 )) && all(greaterThan( z, -plane3 ) );
bool reject = all(greaterThan( z, -plane0 )) && all(greaterThan( z, -plane1 )) && all(greaterThan( z, -plane2 )) && all(greaterThan( z, -plane3 ));
if( no_plane && reject )
{
full_light = false;
Expand Down
5 changes: 2 additions & 3 deletions res/gamedata/shaders/gl/shared/waterconfig.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef _WATERCONFIG_H
#define _WATERCONFIG_H

//íàñòðîéêè äëÿ: (1)
//waterdistortion
//waterdistortion2

Expand All @@ -20,7 +19,7 @@
////////////////////////////////////////////////////////////////////////////////
-- waters clear
////////////////////////////////////////////////////////////////////////////////
íàñòðîéêè äëÿ:

waterdistortion
waterdistortion2
////////////////////////////////////////////////////////////////////////////////
Expand All @@ -32,7 +31,7 @@
#define W_DISTORT_AMP_1 (-1.75) //(-0.30)
#define W_DISTORT_POWER (1.0) //(1.0)
////////////////////////////////////////////////////////////////////////////////
íàñòðîéêè äëÿ:

waterdistortion
waterdistortion
////////////////////////////////////////////////////////////////////////////////
Expand Down
Binary file modified res/gamedata/shaders/gl/ssao_blur.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/ssao_hdao.ps
Binary file not shown.
58 changes: 25 additions & 33 deletions src/Layers/xrRender/R_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ class ECORE_API CBackend
ID3DRenderTargetView* pRT[4];
ID3DDepthStencilView* pZB;
#elif defined(USE_OGL)
// TODO make it valid(?), set target as GL_NONE
ref_rt ref_invalid{};

GLuint pFB;
GLuint pRT[4];
GLuint pZB;
ref_rt* pRT[4] = {&ref_invalid, &ref_invalid, &ref_invalid, &ref_invalid};
ref_rt* pZB = &ref_invalid;
#else
# error No graphics API selected or enabled!
#endif
Expand Down Expand Up @@ -274,13 +277,25 @@ class ECORE_API CBackend
IC void set_ZB(ID3DDepthStencilView* ZB);
IC ID3DRenderTargetView* get_RT(u32 ID = 0);
IC ID3DDepthStencilView* get_ZB();
IC void unset_RT(u32 ID)
{
set_RT(nullptr, ID);
}
#elif defined(USE_OGL)
IC void set_FB(GLuint FB = 0);
IC void set_RT(GLuint RT, u32 ID = 0);
IC void set_ZB(GLuint ZB);
IC void set_RT(const ref_rt& RT, u32 ID);
IC void unset_RT(u32 ID);
IC void set_ZB(const ref_rt& ZB);
IC void unset_ZB();
IC GLuint get_FB();
IC GLuint get_RT(u32 ID = 0);
IC GLuint get_ZB();
IC ref_rt& get_RT(u32 ID = 0);
IC ref_rt& get_ZB();

IC void ClearZB(const ref_rt& zb, float depth);
IC void ClearZB(const ref_rt& zb, float depth, u8 stencil);
IC bool ClearZBRect(const ref_rt& zb, float depth, size_t numRects, const Irect* rects);
IC bool ClearRTRect(const ref_rt& rt, const Fcolor& color, size_t numRects, const Irect* rects);
IC void ClearRT(ref_rt& rt, const Fcolor& color);
#else
# error No graphics API selected or enabled!
#endif
Expand All @@ -293,40 +308,17 @@ class ECORE_API CBackend

IC bool ClearRTRect(ID3DRenderTargetView* rt, const Fcolor& color, size_t numRects, const Irect* rects);
IC bool ClearZBRect(ID3DDepthStencilView* zb, float depth, size_t numRects, const Irect* rects);
#elif defined(USE_OGL)
IC void ClearRT(GLuint rt, const Fcolor& color);

IC void ClearZB(GLuint zb, float depth);
IC void ClearZB(GLuint zb, float depth, u8 stencil);

IC bool ClearRTRect(GLuint rt, const Fcolor& color, size_t numRects, const Irect* rects);
IC bool ClearZBRect(GLuint zb, float depth, size_t numRects, const Irect* rects);
#else
# error No graphics API selected or enabled!
#endif

ICF void ClearRT(ref_rt& rt, const Fcolor& color) { ClearRT(rt->pRT, color); }
ICF bool ClearRTRect(ref_rt& rt, const Fcolor& color, size_t numRects, const Irect* rects)
{
return ClearRTRect(rt->pRT, color, numRects, rects);
}

#if defined(USE_OGL)
ICF void ClearZB(ref_rt& zb, float depth) { ClearZB(zb->pRT, depth);}
ICF void ClearZB(ref_rt& zb, float depth, u8 stencil) { ClearZB(zb->pRT, depth, stencil);}
ICF bool ClearZBRect(ref_rt& zb, float depth, size_t numRects, const Irect* rects)
{
return ClearZBRect(zb->pRT, depth, numRects, rects);
}
#elif defined(USE_DX11)
ICF void ClearZB(ref_rt& zb, float depth) { ClearZB(zb->pZRT[context_id], depth); }
ICF void ClearZB(ref_rt& zb, float depth, u8 stencil) { ClearZB(zb->pZRT[context_id], depth, stencil); }
ICF bool ClearZBRect(ref_rt& zb, float depth, size_t numRects, const Irect* rects)
{
return ClearZBRect(zb->pZRT[context_id], depth, numRects, rects);
}
#else
# error No graphics API selected or enabled!
ICF bool ClearRTRect(ref_rt& rt, const Fcolor& color, size_t numRects, const Irect* rects)
{
return ClearRTRect(rt->pRT, color, numRects, rects);
}
#endif

IC void set_Constants(R_constant_table* C);
Expand Down
Loading
Loading