Skip to content

Add lane marking overlay, rural ditches, and 15 cm urban curbs - #62

Merged
adam133 merged 2 commits into
mainfrom
copilot/improve-road-markers-and-ditches
Mar 22, 2026
Merged

Add lane marking overlay, rural ditches, and 15 cm urban curbs#62
adam133 merged 2 commits into
mainfrom
copilot/improve-road-markers-and-ditches

Conversation

Copilot AI commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

LaneMarkingTextureId was generated but never applied to any renderer, making lane lines invisible. Rural roads lacked roadside geometry entirely, and urban curbs were only 5 cm tall.

Lane markings

  • BuildLaneMarkingMesh() duplicates road surface geometry elevated by 5 mm (LaneMarkingClearance) with UV0 set to lane-marking tiling (6 m repeat) — generated for all paved types (not Dirt/Path/Cycleway)
  • MapSceneBuilder.BuildRoad() now creates a LaneMarking child GameObject and applies lane_marking_oneway / lane_marking_twoway material

Rural ditches (1 m deep)

  • BuildDitchMesh() generates a V-profile trench on both sides: road edge → bottom (1.5 m out, 1 m below road surface) → outer edge (3 m out, back to road level)
  • RegionTextures.GetDitchTextureId() returns region-appropriate texture (terrain_grass, terrain_sand, terrain_snow, terrain_mud)
  • MapSceneBuilder creates a Ditch child GameObject for rural roads

Urban curbs (15 cm)

  • IsUrbanRoadType() classifies Residential and Service as urban; everything else is rural
  • UrbanKerbHeight = 0.15f auto-selected for urban roads via the ExtrudeWithDetails(RoadType, ...) overload; rural roads get kerbHeight = 0 (empty kerb mesh) + ditch

RoadMeshResult additions

public readonly Mesh? LaneMarkingMesh;   // overlay mesh, UV0 = lane-marking tiling
public readonly Mesh? DitchMesh;         // null for urban roads
public readonly string DitchTextureId;   // empty when DitchMesh is null
Original prompt

Make sure lane lines and markers are visible in game - I don't think they currently are for some reason.

Also, rural roads should have 1 meter deep ditches on both sides of the road, particularly if it's a flat area.

urban roads should generally have a 15 cm curb that then smooths to the terrain.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

- RoadMeshExtruder: add IsUrbanRoadType(), BuildLaneMarkingMesh(), BuildDitchMesh()
- RoadMeshExtruder: auto-select UrbanKerbHeight (15cm) for Residential/Service, no kerb + ditch for rural roads
- RoadMeshResult: add LaneMarkingMesh, DitchMesh, DitchTextureId fields
- RegionTextures: add GetDitchTextureId() returning terrain_grass / terrain_sand / etc
- MapSceneBuilder: create LaneMarking and Ditch child GameObjects in BuildRoad()
- Tests: update 2 existing kerb tests to use urban road type; add 31 new tests

Co-authored-by: adam133 <20442729+adam133@users.noreply.github.com>
Agent-Logs-Url: https://github.com/adam133/vectorroad/sessions/200fa58d-9ef0-43a8-bc20-20a267046466
@adam133
adam133 marked this pull request as ready for review March 22, 2026 23:53
@github-actions
github-actions Bot requested a review from adam133 March 22, 2026 23:53
Copilot AI changed the title [WIP] Ensure lane lines and markers are visible and add ditches Add lane marking overlay, rural ditches, and 15 cm urban curbs Mar 22, 2026
@adam133
adam133 merged commit 87c2eb9 into main Mar 22, 2026
12 checks passed
@adam133
adam133 deleted the copilot/improve-road-markers-and-ditches branch March 22, 2026 23:59
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.

2 participants