Skip to content

Commit

Permalink
shaders: Add GLSL port of dynamic lighting shaders.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Mar 6, 2016
1 parent b506f1c commit a682820
Show file tree
Hide file tree
Showing 25 changed files with 99 additions and 9 deletions.
Binary file added res/gamedata/shaders/gl/accum_base.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_omni_normal.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_omni_normal_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_omni_normal_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_omni_transluent.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_omni_unshadowed.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_spot_fullsize.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_spot_fullsize_msaa.ps
Binary file not shown.
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_spot_normal.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_spot_normal_msaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_spot_normal_nomsaa.ps
Binary file not shown.
Binary file added res/gamedata/shaders/gl/accum_spot_unshadowed.ps
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_sun_far.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_sun_near.ps
Binary file not shown.
Binary file modified res/gamedata/shaders/gl/accum_volumetric_sun.ps
Binary file not shown.
41 changes: 41 additions & 0 deletions res/gamedata/shaders/gl/iostructs/p_accum_omni.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

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;

#ifdef MSAA_OPTIMIZATION
#ifdef GBUFFER_OPTIMIZATION
float4 _main ( float4 tc, float4 pos2d, uint iSample );
#else
float4 _main ( float4 tc, uint iSample );
#endif
#else
#ifdef GBUFFER_OPTIMIZATION
float4 _main ( float4 tc, float4 pos2d );
#else
float4 _main ( float4 tc );
#endif
#endif

void main()
{
#ifdef MSAA_OPTIMIZATION
#ifdef GBUFFER_OPTIMIZATION
SV_Target = _main ( p_accum_omni_tc, gl_FragCoord, gl_SampleID );
#else
SV_Target = _main ( p_accum_omni_tc, gl_SampleID );
#endif
#else
#ifdef GBUFFER_OPTIMIZATION
SV_Target = _main ( p_accum_omni_tc, gl_FragCoord );
#else
SV_Target = _main ( p_accum_omni_tc );
#endif
#endif
}
36 changes: 27 additions & 9 deletions res/gamedata/shaders/gl/iostructs/p_volume.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@

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 v2p_volume_tc ; // TEXCOORD0;
layout(location = TEXCOORD0) in float4 p_volume_tc ; // TEXCOORD0;
#ifdef USE_SJITTER
layout(location = TEXCOORD1) in float4 v2p_volume_tcJ ; // TEXCOORD1;
layout(location = TEXCOORD1) in float4 p_volume_tcJ ; // TEXCOORD1;
#endif

#ifdef MSAA_OPTIMIZATION
float4 _main ( v2p_volume I, uint iSample );
#ifdef GBUFFER_OPTIMIZATION
float4 _main( p_volume I, float4 pos2d, uint iSample );
#else
float4 _main( p_volume I, uint iSample );
#endif
#else
float4 _main ( v2p_volume I );
#ifdef GBUFFER_OPTIMIZATION
float4 _main( p_volume I, float4 pos2d );
#else
float4 _main( p_volume I );
#endif
#endif

void main()
{
v2p_volume I;
I.tc = v2p_volume_tc;
p_volume I;
I.tc = p_volume_tc;
#ifdef USE_SJITTER
I.tcJ = v2p_volume_tcJ;
I.tcJ = p_volume_tcJ;
#endif

#ifdef MSAA_OPTIMIZATION
SV_Target = _main ( I, gl_SampleID );
#ifdef GBUFFER_OPTIMIZATION
SV_Target = _main( I, gl_FragCoord, gl_SampleID );
#else
SV_Target = _main ( I );
SV_Target = _main( I, gl_SampleID );
#endif
#else
#ifdef GBUFFER_OPTIMIZATION
SV_Target = _main( I, gl_FragCoord );
#else
SV_Target = _main( I );
#endif
#endif
}
31 changes: 31 additions & 0 deletions res/gamedata/shaders/gl/iostructs/p_volume_sun.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

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

layout(location = TEXCOORD0) in float4 p_volume_tc ; // TEXCOORD0;
#ifdef USE_SJITTER
layout(location = TEXCOORD1) in float4 p_volume_tcJ ; // TEXCOORD1;
#endif

#ifdef MSAA_OPTIMIZATION
float4 _main ( v2p_volume I, uint iSample );
#else
float4 _main ( v2p_volume I );
#endif

void main()
{
v2p_volume I;
I.tc = p_volume_tc;
#ifdef USE_SJITTER
I.tcJ = p_volume_tcJ;
#endif

#ifdef MSAA_OPTIMIZATION
SV_Target = _main ( I, gl_SampleID );
#else
SV_Target = _main ( I );
#endif
}

0 comments on commit a682820

Please sign in to comment.