Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(w3ddevice): hold the heat haze pull to a few pixels

Olcay Seygane4842976c6d3
diff --git a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
index ffda6453a..320db1369 100644
--- a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
+++ b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
@@ -921,9 +921,10 @@ End
; "SMUD" as screen distortion instead of a billboard (the 0x44554D53 test in W3DParticleSys.cpp),
; so the texture named here is never loaded. It draws only where the smudge manager reports
; hardware support and Heat Effects are on in the options; elsewhere it draws nothing at all.
-; Large runs out about 100 in a second, Huge about 230 in a second and a half. On the Direct3D 11
-; picture of 2026-10-06 the haze showed hard horizontal bands and a shifted copy of the ground
-; behind it, so the ring is kept at half strength until the smudge pass reads the right frame.
+; Large runs out about 100 in a second, Huge about 230 in a second and a half. The shifted copy of
+; the ground these drew on 2026-10-06 was the smudge pass pulling by a share of each smudge's own
+; width, which on rings this size was twenty pixels; it holds the pull to a few pixels now
+; (W3DSmudge.cpp), so the ring is back at full strength.
ParticleSystem ReforgedHeatRingLarge
Priority = CRITICAL
@@ -943,8 +944,8 @@ ParticleSystem ReforgedHeatRingLarge
SizeRate = 1.20 1.20
SizeRateDamping = 0.97 0.97
Alpha1 = 0.00 0.00 0
- Alpha2 = 0.50 0.50 3
- Alpha3 = 0.30 0.30 15
+ Alpha2 = 1.00 1.00 3
+ Alpha3 = 0.60 0.60 15
Alpha4 = 0.00 0.00 32
Alpha5 = 0.00 0.00 0
Alpha6 = 0.00 0.00 0
@@ -993,8 +994,8 @@ ParticleSystem ReforgedHeatRingHuge
SizeRate = 2.00 2.00
SizeRateDamping = 0.97 0.97
Alpha1 = 0.00 0.00 0
- Alpha2 = 0.50 0.50 3
- Alpha3 = 0.30 0.30 20
+ Alpha2 = 1.00 1.00 3
+ Alpha3 = 0.60 0.60 20
Alpha4 = 0.00 0.00 45
Alpha5 = 0.00 0.00 0
Alpha6 = 0.00 0.00 0
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
index aa9920b88..b11d11022 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
@@ -451,11 +451,19 @@ void W3DSmudgeManager::render(RenderInfoClass &rinfo)
//Ge uv coordinates by interpolating corner uv coordinates and applying desired offset.
uvSpanX=verts[3].uv.X - verts[0].uv.X;
uvSpanY=verts[1].uv.Y - verts[0].uv.Y;
- verts[4].uv.X=verts[0].uv.X+uvSpanX*(0.5f+smudge->m_offset.X);
+ // The pull at the centre is a share of the smudge's own width, which is a shimmer on a
+ // smoke puff and a second copy of the ground on a nuke's heat ring: those are 200 to 350
+ // pixels across at the default zoom, sixteen to twenty-four of them overlap, and each
+ // blended a copy of the ground shifted by up to twenty pixels over the unshifted one,
+ // on both devices. Held to a few pixels of the view it stays a shimmer at any size.
+ const Real MAX_PULL = 0.004f; // of the view's width and height, about 8 pixels at 1920
+ const Real pullX = WWMath::Clamp(uvSpanX*smudge->m_offset.X, -MAX_PULL*texClampX, MAX_PULL*texClampX);
// .Y, not .X: the vertical offset was rolled, clamped against the top and bottom of the
// view a dozen lines up, and then never read - the centre vertex took the horizontal
// one on both axes, so every smudge pulled the background along one diagonal.
- verts[4].uv.Y=verts[0].uv.Y+uvSpanY*(0.5f+smudge->m_offset.Y);
+ const Real pullY = WWMath::Clamp(uvSpanY*smudge->m_offset.Y, -MAX_PULL*texClampY, MAX_PULL*texClampY);
+ verts[4].uv.X=verts[0].uv.X+uvSpanX*0.5f+pullX;
+ verts[4].uv.Y=verts[0].uv.Y+uvSpanY*0.5f+pullY;
count++; //increment visible smudge count.
smudge=smudge->Succ();