Clouds: draw to the Cloud Distance option, not the render distance (#67)

The cloud mesh radius came from the render distance, the far plane was
capped at max(4 x render distance, 1024) and the cloud fog end was a
constant 2048, so lowering the render distance cut the clouds short.
Vanilla ties all three to options.cloudRange: CloudRenderer.prepare
builds ceil(range * 16 / 12) cells, Camera.depthFar is
max(4 x render distance, range * 16) (also the hand projection, the
frustum and the world border), and AtmosphericFogEnvironment ends
cloud fog at min(range * 16, visual/cloud_fog_end_distance).

The cloud render harness now checks the radius for Cloud Distance
2..128 against the shipped mesh builder, and the environment harness
covers visual/cloud_fog_end_distance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-14 14:38:52 +02:00
parent 6c1000a374
commit 12eca8a5c1
11 changed files with 95 additions and 14 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""Compare fancy cloud exterior/interior faces and nearest-first mesh traversal with 26.3."""
"""Compare fancy cloud exterior/interior faces, nearest-first mesh traversal and the
cell radius of the Cloud Distance option (independent of the render distance) with 26.3."""
try:
from . import lab, oracle_harness as harness
except ImportError:
@@ -16,6 +17,9 @@ def make_input(build):
for radius in range(11):
for bottom in (-5, -4, 0, 1):
cases.append(f"1 {radius} 0 {bottom} 0\n")
# CloudRenderer.prepare: radius from options.cloudRange (2..128 chunks).
for cloud_range in (2, 3, 4, 7, 8, 12, 32, 64, 127, 128):
cases.append(f"2 {cloud_range} 0 -5 0\n")
inputs = build / "inputs.txt"
inputs.write_text("".join(cases))
return inputs, len(cases)