Repository navigation
Roads: skirts drop each road's edges into the ground, so roads don't float - #1564
Merged
Merged
Conversation
…float A road was a ribbon lifted above the terrain (0.35 m in a generated world, so it doesn't z-fight the terrain mesh), and from the side it floated, its shadow a dark band under it. road_mesh_params::skirt_depth (> 0) drops every strip's edges, an open strip's ends where no junction pad covers them, and every pad's rim in a wall to that far below the sampled ground, a shade darker than the road (skirt_shade), so a road reads as a layer of pavement set into the terrain. A generated world's roads take skirt_depth 0.5. The walls take the road top's up normal: a slanted normal comes back from a glb a bit different each time (assimp normalises normals as it writes them), and a world read back must write the same bytes again (CityBundleV2). A closed wall joins its last point to its first instead of repeating it. The road mesh is render-only, so the walls change no physics. Test: WorldRoadMesh.ASkirtDropsTheEdgesIntoTheGround.
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.
Joe: the terrain roads "appear to float above the ground when you look at them from the side. The sides should drape down into the ground like it is a layer of pavement".
Why they floated
A road is a ribbon of triangles lifted above the terrain so it doesn't z-fight the terrain mesh. In a generated world that lift is 0.35 m. The ground under it is sampled only at the ribbon's vertices. So from the side you saw a thin band hovering over the ground, with a dark shadow band under it.
What changes
road_mesh_params::skirt_depth. When it's above 0, these drop in a wall to that far below the sampled ground:skirt_shade, 0.75), so a road reads as a slab of pavement set into the terrain.skirt_depth = 0.5.CityBundleV2's check that a world read back writes the same bytes again. An up normal round-trips exactly.role_render).Checked
WorldRoadMesh.ASkirtDropsTheEdgesIntoTheGround, on a straight road and a crossing:arigl snapshot. These are local and weren't committed.Open
About 0.35 m of wall shows above the ground, which is the lift. If that reads as a curb, the generated world's
liftcan come down now that the walls hide the join.