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.

feat(w3ddevice): fire light on smoke follows the SmokeFireLighting option

Olcay Seygan94f589d88a9a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d2496220b..8f7614c23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1223,6 +1223,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
- An aircraft's shadow lands where the sun puts it, not underneath the aircraft. Every plane and helicopter in the game's own data asks for a sun "no lower than 89 degrees", so each one cast its shadow straight down and towed it along directly below itself at any height, while the tank beside it was lit by the map's real sun and threw its shadow off to the side. Aircraft now take the same sun as everything else: a helicopter's shadow slides out from under it as it climbs, and a plane's runs ahead of or behind it depending on the hour the map is set at. On a map lit by a very low sun the shadow is held to what a 30 degree sun would cast, so it does not stretch across half the screen. The flat blob shadows under missiles and bombs follow the same ray.
- A big smoke cloud darkens the ground under it and fades as it does.
- Smoke and dust stand in the sunlight. A column off a burning building throws a soft shadow as thick as the smoke is: a puff of dust barely tints the sand, a black plume darkens the ground, the tanks and the houses under it and the smoke behind it. The column itself is bright on the side facing the sun and goes dark on the far side, and a cloud drifting through a building's shadow greys over with everything else in there. A cloud used to cast a round patch straight down whichever way the sun stood, and took no shade from anything. Fire casts nothing, it is light. A machine that cannot run the newer picture keeps the round patch.
+- Fire lights its own smoke. The bottom of a column over a burning tank glows orange from the flames under it and flickers with them, then goes grey as it climbs out of their reach; an explosion's flash warms the smoke drifting past it. Smoke used to keep the same flat grey right down into the fire. Both renderers draw it.
- The soft blob shadow for trees and scenery had never been drawn at all.
- Every one of the 128 tree types casts now, plus the bushes and palms.
- A tree's shadow is the tree. Trunk, crown, and the gaps between the leaves, lying along the
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DParticleSys.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DParticleSys.cpp
index a76b5e5d0..db1d9ce28 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DParticleSys.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DParticleSys.cpp
@@ -88,9 +88,6 @@ static Bool particlePresetShader( ParticleSystemInfo::ParticleShaderType type, S
// what measure the light. All of it is client-side colour on the CPU, so both devices draw it.
//-------------------------------------------------------------------------------------------------
-/// placeholder for the option; becomes TheGlobalData->m_smokeFireLighting once that field exists
-static const Bool SMOKE_FIRE_LIGHTING = TRUE;
-
static const Int SMOKE_LIGHTS_MAX = 32; ///< lights gathered a frame, the strongest kept
static const Int SMOKE_LIGHTS_PER_SYSTEM = 4; ///< lights one smoke system evaluates per particle
static const Real FIRE_LIGHT_FULL_WEIGHT = 120.0f; ///< sum of brightness x size at which a fire is full strength
@@ -521,7 +518,7 @@ void W3DParticleSystemManager::doParticles(RenderInfoClass &rinfo)
fillJob.extentX = beX;
fillJob.extentY = beY;
fillJob.extentZ = beZ;
- fillJob.lightCount = SMOKE_FIRE_LIGHTING ? gatherSmokeLights( fillJob.lights, bbox ) : 0;
+ fillJob.lightCount = TheGlobalData->m_smokeFireLighting ? gatherSmokeLights( fillJob.lights, bbox ) : 0;
JobSystem::parallel_for( (Int)m_billboardFills.size(), BILLBOARD_FILLS_PER_CLAIM, fillBillboards, &fillJob );
size_t nextFill = 0;
for( ParticleSystemManager::ParticleSystemListIt it = particleSysList.begin(); it != particleSysList.end(); ++it)