Skip to content

refactor(w3dshadermanager): Remove unused flat shroud texture shader - #3474

Draft
bobtista wants to merge 9 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/remove-flat-shroud-shader
Draft

bobtista wants to merge 9 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/remove-flat-shroud-shader

Conversation

@bobtista

Copy link
Copy Markdown

W3DShaderManager registers FlatShroudTextureShader as ST_FLAT_SHROUD_TEXTURE. Nothing selects that shader type, so the class never runs. It still holds its own copy of the shroud projection code and calls DX8Wrapper directly.

Now the class, its shader list and the ST_FLAT_SHROUD_TEXTURE value are removed.

Todo:

  • Build win32 and vc6, including W3DView and WorldBuilder
  • Load two skirmish saves and the shell map, open W3DView, and open WorldBuilder. Same result as main

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae7546b0-ca51-481f-9fd2-7350bc1c8e90

📥 Commits

Reviewing files that changed from the base of the PR and between f746af7 and 8e9a8a0.


📒 Files selected for processing (51)
  • Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DShaderManager.h
  • 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/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/dx8polygonrenderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h
  • Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/matpass.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/streakRender.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
  • Core/Tools/W3DView/ScreenCursor.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/boxrobj.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.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/mapper.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.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

💤 Files with no reviewable changes (1)
  • Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DShaderManager.h

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



Walkthrough

The change adds rendering operations to the Renderer interface and DX8 backend, then routes WW3D, game, and editor rendering code through that interface. It also removes the flat-shroud shader-list entry and updates river vertex colors based on shroud data when available.

Changes

Renderer API Migration

Layer / File(s) Summary
Renderer interface and DX8 forwarding
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp, Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h
Renderer adds device, render-target, state, buffer, draw, transform, lighting, and fog operations. DX8Backend forwards these operations to DX8Wrapper.
WW3D rendering and state callers
Core/Libraries/Source/WWVegas/WW3D2/*, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/*
WW3D classes use Renderer for rendering state, buffer binding, drawing, transforms, render-target operations, and device queries. Existing sorting paths and draw parameters remain as described.
Terrain, effects, and water rendering
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DShaderManager.h, Core/GameEngineDevice/Source/W3DDevice/GameClient/*, Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/*
Terrain, shader, effect, and water paths use Renderer for rendering operations. The flat-shroud shader is removed from the shader list. River vertex colors use shroud levels when available.
Scene objects and shadows
GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/*
Object, overlay, and shadow rendering paths use Renderer for state setup, resource binding, capability checks, and drawing.
Editor and preview rendering
Core/Tools/W3DView/ScreenCursor.cpp, GeneralsMD/Code/Tools/WorldBuilder/src/*
W3DView and WorldBuilder use Renderer for rendering operations and render-target setup.

Priority: ➖ Normal

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

Change: Refactor

Suggested reviewers: xezon

Merge Risk: ⚪ Minimal · up to 8e9a8

No merge-blocking issue is established by the available evidence. The river-shroud lookup concern predates this change.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check Passed The description explains the removal of the unused flat shroud texture shader, its shader-list entry, and enum value. It also records build and runtime validation.
Title check Passed The title clearly identifies the removal of the unused flat shroud texture shader, which is a documented change in the pull request.
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.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

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