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
+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