From 45a97a75a41cb68f0aba335b0e56583127c8897b Mon Sep 17 00:00:00 2001 From: stm <14291421+stephanmeesters@users.noreply.github.com> Date: Sat, 27 Jun 2026 16:18:11 +0200 Subject: [PATCH 1/2] perf: Render ground-aligned particles without sorting --- Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index bd7f2c9a84e..5ce77276110 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -926,8 +926,14 @@ void PointGroupClass::Render(RenderInfoClass &rinfo) DX8Wrapper::Set_Shader(Shader); DX8Wrapper::Set_Texture(0,Texture); + // TheSuperHackers @perf stephanmeesters 27/06/2026 // Enable sorting if the primitives are translucent and alpha testing is not enabled. - const bool sort = (Shader.Get_Dst_Blend_Func() != ShaderClass::DSTBLEND_ZERO) && (Shader.Get_Alpha_Test() == ShaderClass::ALPHATEST_DISABLE) && (WW3D::Is_Sorting_Enabled()); + // However, do not apply sorting for ground-aligned (i.e. non-billboard) particles. + // This is for performance reasons and because ground-aligned particles do not generally benefit from back-to-front sorting. + const bool sort = Billboard && + Shader.Get_Dst_Blend_Func() != ShaderClass::DSTBLEND_ZERO && + Shader.Get_Alpha_Test() == ShaderClass::ALPHATEST_DISABLE && + WW3D::Is_Sorting_Enabled(); IndexBufferClass *indexbuffer; int verticesperprimitive;/// lorenzen fixed From 8ab6dd2a184c64885752b9cf3c3b1406ccabaf62 Mon Sep 17 00:00:00 2001 From: stm <14291421+stephanmeesters@users.noreply.github.com> Date: Tue, 30 Jun 2026 23:01:36 +0200 Subject: [PATCH 2/2] Clarify bugfix comment, add info comment for volumetric particles --- Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 5ce77276110..01885bdb162 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -926,10 +926,10 @@ void PointGroupClass::Render(RenderInfoClass &rinfo) DX8Wrapper::Set_Shader(Shader); DX8Wrapper::Set_Texture(0,Texture); - // TheSuperHackers @perf stephanmeesters 27/06/2026 + // TheSuperHackers @bugfix stephanmeesters 30/06/2026 // Enable sorting if the primitives are translucent and alpha testing is not enabled. - // However, do not apply sorting for ground-aligned (i.e. non-billboard) particles. - // This is for performance reasons and because ground-aligned particles do not generally benefit from back-to-front sorting. + // However, do not apply sorting to ground-aligned particles. This improves performance and resolves rendering + // artifacts caused by clipping between ground-aligned particles and billboard particles. const bool sort = Billboard && Shader.Get_Dst_Blend_Func() != ShaderClass::DSTBLEND_ZERO && Shader.Get_Alpha_Test() == ShaderClass::ALPHATEST_DISABLE && @@ -1841,7 +1841,9 @@ void PointGroupClass::RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int DX8Wrapper::Set_Shader(Shader); DX8Wrapper::Set_Texture(0,Texture); + // TheSuperHackers @info stephanmeesters 30/06/2026 // Enable sorting if the primitives are translucent and alpha testing is not enabled. + // Volumetric particles that are ground-aligned must have sorting enabled. const bool sort = (Shader.Get_Dst_Blend_Func() != ShaderClass::DSTBLEND_ZERO) && (Shader.Get_Alpha_Test() == ShaderClass::ALPHATEST_DISABLE) && (WW3D::Is_Sorting_Enabled()); IndexBufferClass *indexbuffer;