Skip to content

refactor(ww3d2): Route the shroud overlay via Renderer - #3704

Draft
bobtista wants to merge 18 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-shroud-overlay
Draft

bobtista wants to merge 18 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-shroud-overlay

Conversation

@bobtista

Copy link
Copy Markdown

Follow up for #2613
Merge after #3700

This change moves the shroud overlay into the renderer backend.

Game code passes a RenderShroudOverlay with the shroud texture and its world to texture projection. The DX8 backend sets the material, shader, depth test and texture projection in the same order as before.

The stage 1 water track pass and the debug fog of war view keep the old path.

Testing

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds rendering and capability methods to Renderer and implements them in DX8Backend. It migrates WW3D, game, and tool rendering paths from DX8Wrapper to Renderer. It also adds a renderer-managed shroud overlay path and changes render-target initialization handling.

Changes

Renderer interface migration

Layer / File(s) Summary
Renderer API and DX8 backend
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
Adds Renderer methods for capabilities, resource binding, drawing, render targets, texture transforms, lighting, fog, and shroud overlays. DX8Backend implements these methods.
WW3D library rendering and capability checks
Core/Libraries/Source/WWVegas/WW3D2/*
WW3D renderers, texture mappers, sorting, texture-format selection, and capability checks now use Renderer.
Game rendering and shader paths
Core/GameEngineDevice/Source/W3DDevice/*, Generals/Code/GameEngineDevice/Source/W3DDevice/*, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/*
Terrain, water, shadows, roads, UI, and other game rendering paths now use Renderer. ShroudTextureShader can select a renderer-managed overlay. Render-to-texture initialization rejects multisampled targets and releases resources if target setup fails.
Editor and preview rendering
Core/Tools/W3DView/ScreenCursor.cpp, Generals/Code/Tools/WorldBuilder/src/*, GeneralsMD/Code/Tools/WorldBuilder/src/*
Screen cursor and WorldBuilder drawing use Renderer for rendering operations. Preview generation uses Renderer to set and restore render targets.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant ShroudTextureShader
  participant Renderer
  participant DX8Backend
  ShroudTextureShader->>Renderer: Begin shroud overlay with texture and projection
  Renderer->>DX8Backend: Configure overlay state and texture transform
  ShroudTextureShader->>Renderer: End shroud overlay during reset
  Renderer->>DX8Backend: Unbind texture and restore overlay states
Loading

Suggested labels: Refactor, Gen, ZH

Suggested reviewers: xezon, stephanmeesters, cryotherenegade

Merge Risk: Minimal · up to 58d07

This change moves rendering calls behind the Renderer interface and keeps the existing DX8 behavior. No concrete regression was identified in review, and the author reports identical rendering in a replay comparison. Merge risk looks low.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names a refactor of the shroud overlay routing through the Renderer in ww3d2. The changeset is mostly a broad migration of DX8Wrapper calls to Renderer across many files, and it adds Rendere…
Description check Passed The description states that the change moves the shroud overlay into the renderer backend. It names RenderShroudOverlay, the DX8 backend ordering, the water track and debug fog-of-war exclusions, and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a refactor of the shroud overlay routing through the Renderer in ww3d2. The changeset is mostly a broad migration of DX8Wrapper calls to Renderer across many files, and it adds Renderer.h, DX8Backend shroud overlay support, and Begin/End_Shroud_Overlay. The title matches the PR objective of moving the shroud overlay into the renderer backend. It covers a real part of the change but not the full migration, so it is partially related and passes.

Full details: Description check

Explanation

The description states that the change moves the shroud overlay into the renderer backend. It names RenderShroudOverlay, the DX8 backend ordering, the water track and debug fog-of-war exclusions, and the testing performed. It relates directly to the changeset, so it passes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f98785a2-4e9d-4462-aef1-dbd2cd73e485
Commits

Reviewing files that changed from the base of the PR and between 1f876ba and 58d0787.

Files selected for processing: 71

  • Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScorch.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSnow.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainParticles.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Renderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/mapper.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/matpass.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/matrixmapper.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/mesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/meshmdl.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/texture.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp
  • Core/Tools/W3DView/ScreenCursor.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBibBuffer.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DStatusCircle.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp
  • Generals/Code/Tools/WorldBuilder/src/DrawObject.cpp
  • Generals/Code/Tools/WorldBuilder/src/ObjectPreview.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBibBuffer.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DStatusCircle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/linegrp.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/ObjectPreview.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant