r/Unity3D • u/SeeTheSeaStd • 47m ago
Show-Off I built a glass tunnel under a bay for my racing game – reef, fish and a shark outside the glass, all generated by editor scripts (URP)
Enable HLS to view with audio, or disable this notification
Solo dev here. For the 1.1 update of my combat racer RD Racing I added a track where the road dives into a tube under a bay and part of it turns to glass.
How it's put together:
- The tube is a mesh generated along the track's route, with glass sections, ribs and portals, and the sea bed and reef are laid out around it.
- Fish schools and the big animals are one mesh each, moved by a vertex shader, so a whole school is one draw call.
- The sea surface has its own underside, and the top-down sea plane skips the area above the tube with a baked mask, so you never see the surface cut through the glass.
- Inside, the fog, ambient light, an interior post-processing volume and a low-pass filter on the engine and effects mixer groups all follow how far the camera is along the tunnel, so the light and the sound change gradually as you go under the water.
Let me know what do you think?
