Repository navigation
terrain_lab as an Ariadne document, on demo3's render path - #964
Merged
Merged
Conversation
terrain_lab's world moves into libcvc as cvc::world::generate_world (GL-free, deterministic), drawn by a new generated_world scene node type in the cvcGL extension bundle and driven by cvc://components/world_controls.ari. examples/ariadne/documents/terrain_lab.ari is the lab as a document and the template for a generated world; the C++ terrain_lab draws the same builder. The document declares demo3-csma's render discipline, which needed new keys: shadows.focus (a fixed sphere, or following the camera, re-aimed by tick_scene), shadows.softness, casts_shadow on any node, material.opaque (GeometryNode::setForceOpaque, new), and a rig's wash. cloud_sky takes extent/base/top, and no longer overwrites its ground's texture when its shadow starts off. Scale: the island-scaled pines stood 20-100 m; they are calibrated to 3-31 m. The Austin archetypes were squeezed into 10 m lots at a third of their height; fit_buildings gains true_scale (pick an archetype that fits the lot near its own size) and the lab's lots are 16 x 28 m. docs/roadmap/GENERATED-WORLD-ROADMAP.md plans the generator switch, the street/lot/terrain models, and the conference's world.
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.
terrain_lab ported to an Ariadne document that follows the lsystem_forest.ari pattern, on the render discipline of demo3-csma (CVC-DBG's Austin convoy demo, our fastest cvcGL scene). This is the template for a generated world that other apps, the conference among them, can build on.
What changes
cvc::world::generate_world(inc/cvc/world/generated_world.h) is terrain_lab's world, moved out of the example, GL-free and deterministic. It covers:paint_surface);water_level_m(water_field);world_geometryfor physics and nav.examples/cvcgl/terrain_lab.cppnow draws it, down from 1793 lines to about 900.generated_worldscene node type (src/cvcGL/ariadne/world_nodes.cpp), registered inregister_cvcgl_extensions, so arigl, the gallery and the conference client all have it.ground:.world.*state keys are driven by the newcvc://components/world_controls.ari. A change regenerates the world in place; a colour change only repaints the texture.examples/ariadne/documents/terrain_lab.ari, plus aterrain_lab_arigallery entry. It has no thumbnail yet, so the gallery shows its placeholder.demo3's render path as scene keys
demo3 is fast by discipline, not custom GLSL. These are the pieces of it an
.aricould not express before (documented in ARIADNE.md §5.4):shadows.focus:camera,{follow: camera, min_radius, max_radius, per_distance, lead, lift, ground}or{center, radius}SceneGraph::setShadowFocus, re-aimed each frame bytick_scene(demo3's formula)shadows.softnesssetShadowSoftnesscasts_shadow: falseon any nodeGraphicsNode::setCastsShadowmaterial: { opaque: true }GeometryNode::setForceOpaque(no per-texel alpha scan)wash:The document uses all of them, with demo3's soft afternoon look: sun key 1.3 at azimuth −60° and elevation 28°, fill 0.3, no back light or wash, a 4096 shadow map and a daylight sky.
Fixes found along the way
cloud_skytakesextent/base/top, so its slab fits a 1.2 km world. With its shadow starting off, it no longer overwrites its ground node's texture with white.fit_buildingsgainstrue_scale: it picks an archetype that fits the lot at 0.85–1× its own size, or leaves the lot empty. The lab's lots are now 16 × 28 m.fit_buildings' default behaviour is unchanged.Plan
docs/roadmap/GENERATED-WORLD-ROADMAP.mdcovers:room_view, and avatar statics on the terrain;The street, lot and terrain models follow the DBG project's private scene generator. Porting them needs its author's and the PI's OK first; the roadmap records that gate without the private details.
Testing (Windows, MSVC 14.44, cvcpkg prefix)
world_generated_test, 6 tests: determinism, terrain = relief, dry-land props, water fill, geometry, presets, trees under 35 m;WorldSites.TrueScaleFitsArchetypesAtTheirOwnSize;AriadneScene.FastPathShadowKeys;generated_world+ shadow-focus block incvcgl_ariadne_realize: realize, a seeded key, the focus aimed bytick_scene, and regeneration in place.ariadne_loader_test(211),world_sites/world_road_mesh/world_raster/world_buildings/lsys_forest, and the 84 ctest entries matchingariadne|world_|lsys_|cvcgl_|terrain|physics_world|nav_worldall pass.terrain_labframe is unchanged by moving the builder;arigl snapshot terrain_lab.arirenders with the panel, the Austin city, water, clouds and camera-focused shadows;