Repository navigation
World GB3 part 1: everything the renderer draws is in the bundle - #1496
Merged
Merged
Conversation
… world_from_bundle
This was referenced Nov 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GB3 part 1 of ARIADNE_WORLDS section 18.8 ("one renderer"): everything cvcGL's world renderer draws is now in the world's bundle, and
world_from_bundlemakes the drawn world from any bundle. Part 2 (next PR) has cvcGL draw a world dataset, a city's included, through this.What changes
The bundle holds what the renderer draws (
generated_world_bundle):props_r1.glbandprops_r2.glb, the props' coarser rungs (render only);props.json, the props' render cells: the cell size and, per cell, its bounds and its run of triangles (lines, for the needles) in each prop mesh. A cell's points are the ones its faces use, which a glb read back keeps together;streets.json, the street network the roads were extruded from (nodes; segments with width, class, arterial) and the city's counts (buildings, archetypes, districts, road length);ground.png, the painted ground in the material colours at 2048 a side, north at the top. Callers that already painted it pass it in (world_ground); otherwise it is painted for the bundle.world_from_bundle(app, bundle, reader)gives agenerated_worldand its ground from a loaded bundle of any version:edge_walls;ground.png, else a version 1 city'ssatellite.png.Written again with its ground, a generated world's bundle gives the same bytes and hash.
terrain_water_bodies(terrain, level): the builder's water step, factored out. It now takes rows and columns separately, so a city's terrain that is not square works; for a square terrain the result is unchanged.cvc::encode_png(newimage_encode.h): PNG bytes in memory through stb, the same pixels always giving the same bytes.city_bundle_dir_reader(dir): the directory readerload_city_bundlealready used, now public.generated_world::surfaces:geometry()'s surface table when there is no model (a world read from a bundle).cvcGL's world job now paints, then writes the bundle, so the bundle's ground is the texture just painted (in the material colours at 2048, the default) instead of a second painting. The first world does the same.
The headless
data-generateand the drawn node both write the same ground, so the drawn world's dataset hash still equals the headless one (cvcgl_ariadne_physics).Tests
world_bundle_v2_test, 3 new tests (9 in all):AGeneratedWorldReadsBackAsTheWorldItDraws: a world with water, read back. It has the same params, terrain and cell surfaces; the same faces in all seven meshes; the same cells (runs, bounds, and each cell's mesh); the same streets and counts; the same terrain chunks (rungs, errors, water rungs); and the same wet cells. Its ground is the material painting texel for texel. Written again, every file has the same bytes and the bundle the same hash.AVersionOneCityIsAWorldToDraw: a version 1 city with a non-square, off-centre terrain and a satellite image becomes a world to draw: terrain chunks, no water, and the satellite image as its ground, south row first.ABadRendererFileSaysWhy: a cell run outside its mesh, a cell of the wrong width, a segment naming a missing node, and a badground.pngeach fail with a message naming the problem.AGeneratedWorldIsTheSameWorldReadBackpasses the new files through when it rewrites the geometry.Locally (MSVC Release, full build): 2,123 matching world, ariadne, data, nav, bundle and cvcGL ariadne tests pass,
cvcgl_ariadne_physicsamong them. The four reformatted files had whitespace-only changes after that run.Not in this PR