Skip to content

generated_world: an organic ground texture, not the material grid - #966

Merged
transfix merged 1 commit into
masterfrom
feat/organic-ground-texture
Nov 2, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/organic-ground-texture

Conversation

@transfix

@transfix transfix commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Stacked on #964. Review that first; this PR's own change is the top commit, 9063e07.

The baked ground texture showed the material raster's grid as squares. The raster is a few metres a cell (385 cells over 1.2 km), and paint_surface gave each texel its nearest cell's colour.

What changes (cvc::world::paint_surface)

  • Material mode now blends the four cells around each texel. The sample position is pushed about one cell by low-frequency noise (domain warping), and the blend fractions are jittered by finer noise and smoothstep-eased. Classes meet along frayed, organic edges, and a lone cell shows as a soft patch instead of a square. Grass's dirt and dry-grass breakup is weighted by how much of the texel is grass.
  • Asphalt is not warped, so road edges in the raster stay straight under the extruded road ribbons.
  • Risk and height, continuous fields, are interpolated. Occupancy, a yes/no QA view, keeps its cells.
  • Speed: the rows paint in parallel under OpenMP (CVC_USING_OPENMP). A 2048² texture takes 0.32 s, about what the old nearest-cell paint took single-threaded; single-threaded the new paint is about 1.2 s. Every texel depends only on its position, so the result is the same on any thread count.

Testing (Windows, MSVC 14.44)

  • WorldGenerated.SurfaceIsInterpolatedNotCells checks two things:

    • risk paints far more distinct colours than the cells have distinct values;
    • the material texture varies within the non-grass cells that sit on a class boundary, and painting is deterministic.

    The old nearest-cell paint fails the boundary check, because every texel of a cell got the same colour.

  • world_generated_test: all 7 tests pass.

  • A close-up arigl snapshot of terrain_lab.ari shows grass, scree and dirt meeting in organic shapes instead of a grid, with the roads unchanged.

Base automatically changed from feat/ariadne-terrain-lab to master November 2, 2026 00:05
paint_surface painted each texel its nearest raster cell's colour, and the
raster is a few metres a cell, so the ground showed the grid as squares.
Material mode now blends the four cells around each texel at a position
warped about a cell by low-frequency noise, with the blend's fractions
jittered by finer noise and eased: classes meet along frayed, organic edges
and a lone cell is a soft patch. Asphalt is not warped, so road edges stay
straight. Risk and height are interpolated; occupancy keeps its cells.
The rows paint in parallel under OpenMP (0.32 s for 2048^2, about what the
nearest-cell paint took single-threaded).
@transfix
transfix force-pushed the feat/organic-ground-texture branch from 9063e07 to 10d267e Compare November 2, 2026 01:51
@transfix
transfix enabled auto-merge (squash) November 2, 2026 01:51
@transfix
transfix merged commit a8f2b7c into master Nov 2, 2026
27 checks passed
@transfix
transfix deleted the feat/organic-ground-texture branch November 2, 2026 03:28
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