The wireframe stands against black

Alt+W held the sky dome solid so the edges had something to read
against. Looking at it, the dome was the problem: lit, fogged and
filling the upper half, it washed out everything behind the near
geometry. A whole structure over the track in the middle distance was
invisible until the sky came away.

So the view now clears to BLACK under wireframe and the sky pass is
skipped entirely. Skipping costs nothing - the dome only ever covers
pixels the clear already owns - and it removes the two fill-mode
brackets that used to wrap the pass, so the frame is simpler than it
was. Both changes are conditional on gWireframe; the solid path clears
to the fog colour and draws its sky exactly as before.

Fog still applies to the edges, which is why the middle distance tints
toward the fog colour instead of staying bright. That is depth
information, so it stays.

environ.ini's template and BUILD.md both said the sky stayed solid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-08-10 12:50:44 -05:00
co-authored by Claude Opus 5
parent 0f4592c39a
commit ef4a5e501d
3 changed files with 34 additions and 30 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ press again before concluding a key is broken.
| Key | State |
|-----|-------|
| **Alt+W** wireframe | **Live.** Reimplemented on D3D9 as a per-frame `D3DRS_FILLMODE` (`gWireframe`, [MUNGA_L4/L4VIDEO.cpp](MUNGA_L4/L4VIDEO.cpp)). The sky dome and the 2D pass (gunsight, cam-ship HUD) are held solid; particles are wireframed with everything else. |
| **Alt+W** wireframe | **Live.** Reimplemented on D3D9 as a per-frame `D3DRS_FILLMODE` (`gWireframe`, [MUNGA_L4/L4VIDEO.cpp](MUNGA_L4/L4VIDEO.cpp)). The view clears to black and the sky pass is skipped, so the edges stand on their own — with the lit dome in place the far half of the scene is unreadable. The 2D pass (gunsight, cam-ship HUD) is held solid; particles are wireframed with everything else. Fog still applies, so distant edges tint toward the fog colour rather than staying white. |
| **Alt+E** event-queue dump | **Live.** Reaches `GeneralEventQueue::DumpEventQueue`. |
| Alt+V predator vision | Inert. |
| Alt+F frame dump | Inert. |
+30 -26
View File
@@ -6411,15 +6411,25 @@ void DPLRenderer::ExecuteImplementation(RendererComplexity, RendererOrigin::Inte
DWORD currentFog;
mDevice->GetRenderState(D3DRS_FOGCOLOR, &currentFog);
hr = mDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, currentFog, 1.0f, 0);
//
// The frame is normally cleared to the fog colour so the horizon has
// nothing to hide. Under Alt+W it clears to BLACK instead, and the sky
// pass is skipped entirely (below) - so what backs the wireframe is
// black rather than a lit dome, which is the whole point of asking for
// wireframe. Nothing on the solid path changes.
//
hr = mDevice->Clear(
0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
gWireframe ? D3DCOLOR_XRGB(0, 0, 0) : currentFog,
1.0f, 0
);
hr = mDevice->BeginScene();
//
// Alt+W wireframe. Set every frame from the flag rather than once at
// toggle time - see gWireframe. It is turned back off for the sky pass
// and again for the 2D pass below; everything between here and there
// draws as edges.
// toggle time - see gWireframe. It is turned back off for the 2D pass
// below; everything between here and there draws as edges.
//
mDevice->SetRenderState(
D3DRS_FILLMODE,
@@ -6503,33 +6513,27 @@ void DPLRenderer::ExecuteImplementation(RendererComplexity, RendererOrigin::Inte
mDevice->SetTransform(D3DTS_PROJECTION, &mProjectionMatrix);
//
// The sky stays solid under Alt+W. Wireframing the dome fills the top
// of the screen with its own tessellation and buries the geometry you
// turned wireframe on to look at; a solid sky gives the edges something
// to read against.
// The sky is not drawn at all under Alt+W - the black clear above
// stands in for it. Drawing it solid lights the top of the screen and
// drowns the edges you turned wireframe on to look at; drawing it in
// wireframe is worse, filling the same area with the dome's own
// tessellation. Skipping it costs nothing: the dome only ever covers
// pixels the clear already owns.
//
if (gWireframe)
if (!gWireframe)
{
mDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
}
if (!l4_application->IsDead())
{
std::list<d3d_OBJECT*>::const_iterator iter;
for (iter = this->mConsolidatedStaticObjects.begin(); iter != this->mConsolidatedStaticObjects.end(); ++iter)
if (!l4_application->IsDead())
{
(*iter)->Draw(PASS_SKY, &viewTransform, mTargetRenderTime);
std::list<d3d_OBJECT*>::const_iterator iter;
for (iter = this->mConsolidatedStaticObjects.begin(); iter != this->mConsolidatedStaticObjects.end(); ++iter)
{
(*iter)->Draw(PASS_SKY, &viewTransform, mTargetRenderTime);
}
}
}
for (d3d_OBJECT *obj = mRenderLists[PASS_SKY]; obj != NULL; obj = obj->GetNext(PASS_SKY))
obj->Draw(PASS_SKY, &viewTransform, mTargetRenderTime);
if (gWireframe)
{
mDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
for (d3d_OBJECT *obj = mRenderLists[PASS_SKY]; obj != NULL; obj = obj->GetNext(PASS_SKY))
obj->Draw(PASS_SKY, &viewTransform, mTargetRenderTime);
}
//Reactivate fog
+3 -3
View File
@@ -411,9 +411,9 @@ namespace
"# ---- Developer / testing ----------------------------------------------------\n"
"\n"
"# Nonzero arms the debug keys. Two of them do something in this build:\n"
"# Alt+W wireframe. The sky dome stays solid so the edges have\n"
"# something to read against, and the gunsight and cam-ship\n"
"# HUD stay solid too.\n"
"# Alt+W wireframe. The sky is not drawn and the view clears to\n"
"# black, so the edges stand on their own; the gunsight and\n"
"# cam-ship HUD stay solid.\n"
"# Alt+E write the event queue to the log.\n"
"# The others are stubs the 2007 DPL->Direct3D port left behind and do\n"
"# nothing at all. They are named here so a dead key is not mistaken for\n"