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): classic graphics puts the blob back under trees

Olcay Seyganc7e5ebbd0a27
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a428e53eb..c77c3f7f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -705,7 +705,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
## The options screen has pages
- Display, graphics, effects, audio, controls, gameplay and network, behind seven buttons across the top. The original screen was one panel with everything on it at once, and it was already full the day it shipped: the language filter, the keyboard button and four camera checkboxes are all still in there, parked off the right edge where nobody can reach them, because there was nowhere left to put them.
-- Classic Graphics, at the top of the Graphics page, puts the game back the way it looked in 2003 in one click: its own textures and ground in place of the upscaled ones, the old hard shadows, no bump detail on the models and no glow or sharpening over the picture. Leave it off and you have Reforged. The rest of the options stay yours either way, and the box takes effect the next time the game starts.
+- Classic Graphics, at the top of the Graphics page, puts the game back the way it looked in 2003 in one click: its own textures and ground in place of the upscaled ones, the old hard shadows, the round dark patch under every tree where Reforged lays the tree's own outline on the ground, no bump detail on the models and no glow or sharpening over the picture. Leave it off and you have Reforged. The rest of the options stay yours either way, and the box takes effect the next time the game starts.
- Every graphics setting is on the Graphics and Effects pages. Shadows, clouds, ground lighting, soft water edges, trees, extra animations, heat haze, texture resolution and the particle limit used to hide in a popup that only opened if you picked Custom from the detail box on another page, so choosing High never showed you what High turns on. Pick a preset now and its settings change in front of you; touch any one of them and the box reads Custom. Texture filtering and the number of anisotropic samples, which needed a text editor, sit there too.
- Every page is sorted into titled groups by what the settings do, and the groups sit in the same three columns on every tab. On Graphics the detail preset heads the first column with the texture and particle sliders under it, the picture settings take the second and the terrain the third. The framed boxes the original drew inside each page are gone. They were sized for headings that no longer exist, which is why no two pages started their first setting at the same height.
- The detail box has Ultra above High, and a preset now sets everything it is responsible for. Picking High used to leave antialiasing and texture filtering wherever they happened to be; High now brings 4x antialiasing and 8 anisotropic samples with it, and Low turns both down for the machines that need it. Ultra is High with the particle limit at the top of its slider, 5,000 against High's 3,000, detail that is never dropped when the frame rate dips, 8x antialiasing, 16 anisotropic samples, thick smoke and every new shadow and effect switched on. Glow stays yours whichever you pick: the artwork was painted without it.
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp
index 97366cbab..025ab3aa9 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp
@@ -1964,10 +1964,12 @@ static Bool fillShadowInfoFromTemplate(const ThingTemplate *tmplate, Shadow::Sha
tree's triangles on the ground has nothing of theirs to lay, and all they ever had was the round
decal their template asks for. The tree buffer takes their meshes over instead.
- The test is the template's own words: shrubbery, fixed in place, asking for a decal. */
+ The test is the template's own words: shrubbery, fixed in place, asking for a decal. Classic
+ graphics keeps the decal, which is what a palm stood on in 2003. */
static Bool wantsModelShadow(const ThingTemplate *tmplate)
{
return tmplate->getShadowType() == SHADOW_DECAL &&
+ !TheGlobalData->m_classicGraphics &&
TheGlobalData->m_shadowsForProps &&
(TheGlobalData->m_useShadowDecals || TheGlobalData->m_useShadowVolumes) &&
tmplate->isKindOf(KINDOF_SHRUBBERY) &&
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
index 30b94ccab..dde05b1c0 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
@@ -2108,8 +2108,10 @@ void W3DTreeBuffer::drawTrees(CameraClass * camera, RefRenderObjListIterator *pD
// so with volume shadows picked trees were the one thing in the scene standing on nothing.
Bool drawShadows = TheGlobalData->m_useShadowDecals || TheGlobalData->m_useShadowVolumes;
// The silhouette pass needs the vertex shader, since flattening the tree onto the ground is the
- // shader's own sway arithmetic with different constants. Hardware without one keeps the blob.
- Bool silhouetteShadows = drawShadows && m_dwTreeVertexShader != 0 && TheW3DShadowManager != NULL;
+ // shader's own sway arithmetic with different constants. Hardware without one keeps the blob,
+ // and so does classic graphics, because the blob is what every tree had in 2003.
+ Bool silhouetteShadows = drawShadows && m_dwTreeVertexShader != 0 && TheW3DShadowManager != NULL &&
+ !TheGlobalData->m_classicGraphics;
// Draw tree shadows.
// Trees are batched vertices with no render object of their own, so the one shared blob decal