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(ww3d2): reset water transparency before each frame

T0T0W0d7ed868ebb6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5bcf2f6be..b2f170b65 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,11 @@ found and fixed — EA's own, not port damage.**
---
+## Water stays stable while scrolling
+
+- Jagged bands of terrain no longer appear through lakes when moving the camera.
+ Water transparency is refreshed every frame so the shores stay stable while scrolling.
+
## The frame rate cap is gone
- The picture now runs uncapped; the rules keep their own steady clock.
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
index a8d9cbc04..30ed154ee 100644
--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
@@ -848,6 +848,11 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f
WWASSERT(!IsRendering);
IsRendering = true;
+ // Bind the scene target before clearing it. The Direct3D 11 post-process pass
+ // restores the back buffer at the end of each frame; clearing before Begin_Scene
+ // left the offscreen scene's shoreline alpha mask from the previous camera view.
+ DX8Wrapper::Begin_Scene();
+
// If we want to clear the screen, we need to set the viewport to include the entire screen:
if (clear || clearz) {
D3DVIEWPORT9 vp;
@@ -864,9 +869,6 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f
DX8Wrapper::Clear(clear, clearz, color, dest_alpha);
}
- // Notify D3D that we are beginning to render the frame
- DX8Wrapper::Begin_Scene();
-
return WW3D_ERROR_OK;
}