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): smoke self-shade curve 16 by default

Olcay Seygancdb32e6e269e
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
index 4c219729d..f8f17071f 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
@@ -1014,7 +1014,7 @@ Int parseNoSmokeFireLight(char *args[], int)
own figure (the field stays below zero). All of it is client-side colour and shade, read by the
renderer every frame, so a network game and a replay are untouched.
-smokeselfshadow <0..1> how dark a particle on a plume's far side goes (0.8)
- -smokeselfcurve <0.25..32> how fast that shade grows from the plume's sun side (8: the
+ -smokeselfcurve <0.25..32> how fast that shade grows from the plume's sun side (16: the
sun side keeps its brightness, the back takes it all)
-smokegroundshadow <0..1> how dark the thickest smoke leaves the ground and units (0.4)
-smokedensity <0..10> scale on every particle's thickness to the sun (1)
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
index 0f7131541..1cfbc2ea1 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
@@ -142,13 +142,14 @@ const Real cosAngleToCare = cos ((0.2 * PI) / 180.0); //1.5 degree difference
// cloud and the smoke itself scatters some of the sun on. How thick each particle is to the sun is
// particleSunMapOpticalDepth's. The self-shade is a particle's own: how dark one on its plume's far
// side goes, and the power that keeps the sun side lit (ffshader.h, smoke_reaching). The ground
-// figure held up on Golden Oasis on 2026-10-03, and 0.8 and 8 are what the 2026-10-04 sweep picked
-// for the self-shade on soot (sun side 6% under the unshaded plume, far side 0.73 of it), before
-// the shade was measured from the plume's front rather than from a width ahead of its centre.
+// figure held up on Golden Oasis on 2026-10-03. The self-shade's 0.8 and 16 are the 2026-10-04
+// re-sweep's, with the shade measured from the plume's front: white smoke's sun side 6.2% under the
+// unshaded plume and its far side 0.85 of the sun side, soot 2.4% and 0.87. At 8 white lost 10.8%
+// on its sun side; at 32 soot went flat.
// -smokegroundshadow, -smokeselfshadow, -smokeselfcurve and -smokedensity overrule them for a run.
#define SMOKE_SHADOW_STRENGTH 0.4f
#define SMOKE_SELF_SHADOW_GAIN 0.8f
-#define SMOKE_SELF_SHADOW_CURVE 8.0f
+#define SMOKE_SELF_SHADOW_CURVE 16.0f
// W3DParticleSys.cpp: the fire light values the last particle pass used.
extern void W3DSmokeFireTuningInForce( Real *gain, Real *radius, Real *height, Real *cap, Real *fullWeight );
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx11backend.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx11backend.cpp
index cb17af0f3..539d3ebd3 100644
--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx11backend.cpp
+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx11backend.cpp
@@ -321,7 +321,7 @@ DX11BackendClass::DX11BackendClass()
SmokeMapFilled = false;
SmokeStrength = 0.0f;
SmokeSelfGain = 0.8f;
- SmokeSelfCurve = 8.0f;
+ SmokeSelfCurve = 16.0f;
for (unsigned stage = 0; stage < DX11_BACKEND_TEXTURE_STAGES; ++stage) {
set_identity(TextureTransforms[stage]);
}