diff --git a/res/gamedata/shaders/gl/iostructs/p_particle.h b/res/gamedata/shaders/gl/iostructs/p_particle.h new file mode 100644 index 00000000000..9879faa5215 --- /dev/null +++ b/res/gamedata/shaders/gl/iostructs/p_particle.h @@ -0,0 +1,35 @@ + +out vec4 SV_Target; +in vec4 gl_FragCoord; + +struct v2p +{ + float2 tc0 ; // TEXCOORD0; + float4 c ; // COLOR0; + +// Igor: for additional depth dest +#ifdef USE_SOFT_PARTICLES + float4 tctexgen ; // TEXCOORD1; +#endif // USE_SOFT_PARTICLES + + float4 hpos ; // SV_Position; +}; + +layout(location = TEXCOORD0) in float2 p_particle_tc ; // TEXCOORD0; +layout(location = COLOR0) in float4 p_particle_c ; // COLOR0; +#ifdef USE_SOFT_PARTICLES +layout(location = TEXCOORD1) in float4 p_particle_tctexgen; // TEXCOORD1; +#endif // USE_SOFT_PARTICLES + +float4 _main ( v2p I ); + +void main() +{ + v2p I; + I.tc0 = p_particle_tc; + I.c = p_particle_c; + I.tctexgen = p_particle_tctexgen; + I.hpos = gl_FragCoord; + + SV_Target = _main (I); +} diff --git a/res/gamedata/shaders/gl/iostructs/v_particle.h b/res/gamedata/shaders/gl/iostructs/v_particle.h new file mode 100644 index 00000000000..d270869965e --- /dev/null +++ b/res/gamedata/shaders/gl/iostructs/v_particle.h @@ -0,0 +1,49 @@ + +out gl_PerVertex { vec4 gl_Position; }; + +struct vv +{ + float4 P ; // POSITION; + float2 tc ; // TEXCOORD0; + float4 c ; // COLOR0; +}; + +struct v2p +{ + float2 tc ; // TEXCOORD0; + float4 c ; // COLOR0; + +// Igor: for additional depth dest +#ifdef USE_SOFT_PARTICLES + float4 tctexgen ; // TEXCOORD1; +#endif // USE_SOFT_PARTICLES + + float4 hpos ; // SV_Position; +}; + +layout(location = POSITION) in float4 v_particle_P ; // POSITION; +layout(location = TEXCOORD0) in float2 v_particle_tc ; // TEXCOORD0; +layout(location = COLOR) in float4 v_particle_c ; // COLOR; + +layout(location = TEXCOORD0) out float2 v2p_particle_tc ; // TEXCOORD0; +layout(location = COLOR0) out float4 v2p_particle_c ; // COLOR0; +#ifdef USE_SOFT_PARTICLES +layout(location = TEXCOORD1) out float4 v2p_particle_tctexgen; // TEXCOORD1; +#endif // USE_SOFT_PARTICLES + +v2p _main ( vv I ); + +void main() +{ + vv I; + I.P = v_particle_P; + I.tc = v_particle_tc; + I.c = v_particle_c; + + v2p O = _main (I); + + v2p_particle_tc = O.tc; + v2p_particle_c = O.c; + v2p_particle_tctexgen = O.tctexgen; + gl_Position = O.hpos; +} diff --git a/res/gamedata/shaders/gl/particle-clip.vs b/res/gamedata/shaders/gl/particle-clip.vs new file mode 100644 index 00000000000..c18d5a48c7d --- /dev/null +++ b/res/gamedata/shaders/gl/particle-clip.vs @@ -0,0 +1,15 @@ +#include "common.h" +#include "iostructs\v_particle.h" + +v2p _main (vv v) +{ + v2p o; + + o.hpos = mul (m_WVP, v.P); // xform, input in world coords + o.hpos.z = abs (o.hpos.z); + o.hpos.w = abs (o.hpos.w); + o.tc = v.tc; // copy tc + o.c = v.c; // copy color + + return o; +} diff --git a/res/gamedata/shaders/gl/particle.ps b/res/gamedata/shaders/gl/particle.ps new file mode 100644 index 00000000000..5330d992fbb Binary files /dev/null and b/res/gamedata/shaders/gl/particle.ps differ diff --git a/res/gamedata/shaders/gl/particle.vs b/res/gamedata/shaders/gl/particle.vs new file mode 100644 index 00000000000..4300f29c7d6 --- /dev/null +++ b/res/gamedata/shaders/gl/particle.vs @@ -0,0 +1,22 @@ +#include "common.h" +#include "iostructs\v_particle.h" + +uniform float4x4 mVPTexgen; + +v2p _main (vv v) +{ + v2p o; + + o.hpos = mul (m_WVP, v.P); // xform, input in world coords +// o.hpos = mul (m_VP, v.P); // xform, input in world coords + o.tc = v.tc; // copy tc + o.c = unpack_D3DCOLOR(v.c); // copy color + +// Igor: for additional depth dest +#ifdef USE_SOFT_PARTICLES + o.tctexgen = mul( mVPTexgen, v.P); + o.tctexgen.z = o.hpos.z; +#endif // USE_SOFT_PARTICLES + + return o; +} diff --git a/res/gamedata/shaders/gl/particle_alphaonly.ps b/res/gamedata/shaders/gl/particle_alphaonly.ps new file mode 100644 index 00000000000..28d5f2297a9 Binary files /dev/null and b/res/gamedata/shaders/gl/particle_alphaonly.ps differ diff --git a/res/gamedata/shaders/gl/particle_distort.ps b/res/gamedata/shaders/gl/particle_distort.ps new file mode 100644 index 00000000000..64d2439e56a Binary files /dev/null and b/res/gamedata/shaders/gl/particle_distort.ps differ diff --git a/res/gamedata/shaders/gl/particle_distort_hard.ps b/res/gamedata/shaders/gl/particle_distort_hard.ps new file mode 100644 index 00000000000..26849c9442c Binary files /dev/null and b/res/gamedata/shaders/gl/particle_distort_hard.ps differ diff --git a/res/gamedata/shaders/gl/particle_hard.ps b/res/gamedata/shaders/gl/particle_hard.ps new file mode 100644 index 00000000000..a42d6f66828 Binary files /dev/null and b/res/gamedata/shaders/gl/particle_hard.ps differ diff --git a/res/gamedata/shaders/gl/particle_s-aadd.ps b/res/gamedata/shaders/gl/particle_s-aadd.ps new file mode 100644 index 00000000000..bdde0c4cae5 Binary files /dev/null and b/res/gamedata/shaders/gl/particle_s-aadd.ps differ diff --git a/res/gamedata/shaders/gl/particle_s-add.ps b/res/gamedata/shaders/gl/particle_s-add.ps new file mode 100644 index 00000000000..c34e9b08b66 Binary files /dev/null and b/res/gamedata/shaders/gl/particle_s-add.ps differ diff --git a/res/gamedata/shaders/gl/particle_s-blend.ps b/res/gamedata/shaders/gl/particle_s-blend.ps new file mode 100644 index 00000000000..3e002a6bd39 Binary files /dev/null and b/res/gamedata/shaders/gl/particle_s-blend.ps differ