feat(terrain): add RenderAllTerrain flag to allow full-map visibility#2260
feat(terrain): add RenderAllTerrain flag to allow full-map visibility#2260githubawn wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp | Added logic to override heightmap draw dimensions when RenderAllTerrain is enabled, safely done before initHeightData() call |
| Generals/Code/GameEngine/Include/Common/GlobalData.h | Added m_renderAllTerrain boolean field to GlobalData class |
| Generals/Code/GameEngine/Source/Common/GlobalData.cpp | Added INI parser entry for RenderAllTerrain and initialized field to FALSE in constructor |
| GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | Added m_renderAllTerrain boolean field to GlobalData class (Zero Hour variant) |
| GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp | Added INI parser entry for RenderAllTerrain and initialized field to FALSE in constructor (Zero Hour variant) |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Game Initialization] --> B{Load GlobalData INI}
B --> C[Parse RenderAllTerrain flag]
C --> D[W3DTerrainVisual::load]
D --> E{RenderAllTerrain enabled?}
E -->|Yes| F[Get full map extents<br/>getXExtent/getYExtent]
E -->|No| G[Use culled dimensions<br/>getDrawWidth/getDrawHeight]
F --> H[Override heightMap<br/>setDrawWidth/setDrawHeight]
G --> I[Use existing dimensions]
H --> J[initHeightData with full extents]
I --> J
J --> K[Allocate vertex buffers<br/>for terrain rendering]
K --> L[Add render object to scene]
L --> M{Result}
M -->|RenderAllTerrain=Yes| N[Full map visible<br/>No distance culling<br/>Higher VRAM usage]
M -->|RenderAllTerrain=No| O[Standard culled view<br/>Terrain clips at distance<br/>Lower VRAM usage]
Last reviewed commit: 179cf06
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp
Outdated
Show resolved
Hide resolved
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp
Outdated
Show resolved
Hide resolved
|
will also review the build errors soon, changed to draft for now, looking forward to feedback |
|
Unlimited power. Would this maybe be good as an INI setting, like is it important to parse this before the engine init? |
|
Ini could be done. Any file i could use for this? |
b41c7aa to
179cf06
Compare
|
Renamed to a more logical "RenderAllTerrain" from "Unlimitedzoom" |

They thought they could hide in the fog of the old world, General. They were wrong. By initializing the RenderAllTerrain protocols, we have stripped away the limits of our vision.
The earth no longer crumbles at the horizon. To hold the world together, we have diverted at least one hundred megabytes of video memory to the display on our large battlefields. Your GPU will feel the weight of this vast landscape, drawing extra power to render the full scale of our battlefield.
But look! The Americans are exposed. From this height, their bases are a joke and their walls are like sand. Command from the heavens, General, and let our wrath fall upon them. Let nothing remain hidden!
Description: This PR fixes visual clipping issues when running the game with the RenderAllTerrain = Yes. Previously, the terrain rendering system would cull geometry based on the standard camera view frustum logic, which caused terrain segments to disappear when zooming out beyond standard limits.
Modified W3DTerrainVisual::load in Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp
Extent Overrides: When RenderAllTerrain is active, the heightmap's DrawWidth and DrawHeight are forced to match the full map extents (getXExtent/getYExtent). This bypasses the standard culling system's calculated values to ensure the entire map remains visible.
Before:

After:
