Skip to content

cloud_sky: clouds to the horizon, no edge-on bands, one look near and far, no straight edges - #1029

Merged
transfix merged 1 commit into
masterfrom
fix/cloud-deck-look
Nov 6, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/cloud-deck-look

Conversation

@transfix

@transfix transfix commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1013: the five known issues it left in the cloud deck.

What changes

Clouds reach the horizon.

  • The far shells now stay out of the bounds the camera fits and clips to. The new GeometryNode::setUseBounds(false) sets both VTK's UseBounds and cvcGL's own scene box (contributesToSceneBounds).
  • The shells reach far_reach past the ground (4 km by default), where the cloud pattern repeats.
  • A shell vertex past the far plane is drawn on it: its clip-space depth is clamped to 0.999 w. Where it lands on screen, and the world point its fragments read, are unchanged. So the deck reaches the horizon without pushing the camera's near plane out.
  • The near volumes still draw only within horizon of the ground and stay in the bounds, so the default framing holds. That includes the island: lsystem_forest.ari frames as before.

No bands seen edge-on. Each shell now stands for the slab of deck around it. Its fragment marches the view ray across that slab (6 samples, at most 24 slabs' depth) and sums the optical depth, so the 10 slices join into one cloud from below, beside or above. The last 3° fade into haze. I tried and dropped a column-mean slice that every shell reads: it stacked identical footprints into striped pillars at middling angles.

Near and far clouds look alike. VTK's volume shading reads as storm cloud here: dark and metallic, even at ambient 0.85 / diffuse 0.3. So the volumes stay unshaded, and both renderers take one colour ramp from the density: grey-blue where thin, white where dense, the shells a little lighter with height.

No straight-edged clouds. cvc::lsys::cloud_field's turtle wraps x but clamps y at the grid's edges. A cloud that wandered to a y face piled puffs against it, and the grid's window cut them off: a straight edge along the volume's box, reproduced top-down. Each map now fades out over the outer 40% of its radius, which also keeps the clouds round. world_cloud_test checks that nothing reaches the rim.

terrain_bump and bark now name the normal by the node's mapper (new GeometryNode::usesLowMemoryMapper()), not by __EMSCRIPTEN__. With CVCGL_LOWMEM_MAPPER=force, the whole terrain lab (ground, cloud shade, shells, volumes) now draws natively with zero shader errors. Before, the ground failed to compile. So the browser's shader path can be checked on a desktop, as GLSL 150.

Checked (Windows, Release, cvcpkg prefix)

  • world_cloud_test 8/8 (with the new rim check), lsys_fields_test 6/6, cvcgl_ariadne_realize (with a new check that the far shells are out of the scene bounds).
  • arigl snapshot of terrain_lab at 1.2 km and 11.2 km: top-down, overview, low, and from near the ground toward the horizon. Also the default camera (no pin), lsystem_forest.ari, and the forced WebGL2 mapper.

Cost

… far, no straight edges

The five issues #1013 left:
- The far shells leave the camera's bounds (GeometryNode::setUseBounds: VTK's UseBounds and the
  scene's box) and reach far_reach (4 km) past the ground; a vertex past the far plane is drawn on
  it (clip depth clamped to 0.999 w), so the deck reaches the horizon without moving the near plane.
- Each shell marches the view ray across its slab of deck (6 samples) instead of reading one
  layer, so the slices join into one cloud seen edge-on, from below or above.
- The volumes stay unshaded (VTK's volume lighting reads as storm cloud) and share the shells'
  colour ramp: grey-blue thin, white dense.
- The grammar clamps its turtle at the grid's y edges and piled puffs against the face, which
  the window cut off straight; each map now fades out over its outer 40% radius.
- terrain_bump and bark name the normal by the node's mapper (GeometryNode::usesLowMemoryMapper),
  not __EMSCRIPTEN__, so CVCGL_LOWMEM_MAPPER=force draws the whole terrain lab natively.
@transfix
transfix merged commit 38c6b07 into master Nov 6, 2026
27 checks passed
@transfix
transfix deleted the fix/cloud-deck-look branch November 6, 2026 20:45
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