Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the scene’s daytime atmosphere and significantly reworks the orchard road visuals to better match a 2‑lane highway look (continuous asphalt surface, painted center/edge lines, updated roundabout), with a couple of related visual tweaks in the vehicle and terrain.
Changes:
- Adjusts daytime fog/hemisphere lighting parameters for a cooler, more muted look.
- Rebuilds
OrchardRoadsgeometry/materials to a continuous 2‑lane road with center/edge striping and updated roundabout meshes. - Tweaks vehicle visual alignment logic and updates some scene accent materials (and removes the decorative terrain start pad).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/lib/timeOfDay.ts | Updates daytime lighting/fog/hemisphere parameters. |
| src/components/scene/Vehicle.tsx | Adjusts visual chassis Y snap logic and changes a material’s color/emissive. |
| src/components/scene/Terrain.tsx | Removes the decorative start pad mesh. |
| src/components/scene/OrchardRoads.tsx | Reworks road/roundabout geometry generation and materials (2‑lane road + painted lines/curbs). |
Comments suppressed due to low confidence (2)
src/components/scene/OrchardRoads.tsx:143
- Outer edge-line vertices use a single
elycomputed fromgetTerrainHeight(pt.x, pt.z), but the edge-line points are far frompt(near ±halfW). This can cause edge lines to intersect the asphalt on sloped terrain. Compute Y per edge-line vertex instead.
const ely = getTerrainHeight(pt.x, pt.z) + roadElevation + 0.003;
src/components/scene/OrchardRoads.tsx:214
roadVertsuses varying Y values to follow the terrain, but normals are hard-coded to (0,1,0). This makes lighting incorrect on sloped sections (specular/diffuse won't match the actual road surface). Compute vertex normals from the geometry.
const roadGeo = new THREE.BufferGeometry();
roadGeo.setAttribute('position', new THREE.Float32BufferAttribute(roadVerts, 3));
roadGeo.setAttribute('normal', new THREE.Float32BufferAttribute(roadNorms, 3));
roadGeo.setIndex(roadIndices);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+220
to
+221
| // Snap visual chassis to road/ground height under the car so it follows terrain and road surface | ||
| const visualY = getTerrainHeight(pos.x, pos.z) + 0.06 + 0.58; // 0.06m road elevation + 0.58m tire radius offset |
Comment on lines
+114
to
119
| const cy = getTerrainHeight(pt.x, pt.z) + roadElevation + 0.003; | ||
| const cBase = centerVerts.length / 3; | ||
| centerVerts.push( | ||
| pt.x + normX * lineHalfW, cy, pt.z + normZ * lineHalfW, | ||
| pt.x - normX * lineHalfW, cy, pt.z - normZ * lineHalfW | ||
| ); |
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.
No description provided.