Basic road Height Offset test.
It’s now possible to click & drag a knot on the spline to update both the gravel & height non-destructively.
Frame rate was ~30 FPS, but the last terrain tessellate function is a unity CPU function which slows everything down to 5 FPS. Don’t know how to get around that while still being compatible with Unity Terrain.
The picture below uses a 1025x1025 sized heightmap (showing 1/4 of the map). Road edges smooth-transition to the terrain, controlled by the gravel edge slider.
The ‘mesh passing through road’ errors are due to the small 128x128 distance field texture. There’s performance room to move to a larger texture, so will be testing that next.
Changed the height map from a 128x128 basic distance-field to a 256x256 dot splatmap type distance-field. Not 100% perfect yet, but close.
User can adjust the Edge Smoothness 0.0 to 1.0. Very sudden height difference to very smooth blend.
Trees automatically adjust their vertical position depending on edge smoothness, and the user can drag the road anywhere and it all updates. Nothing is baked in.
Need a few more weeks on the heightmap, bug fixes, and auto sign posts after this.
Heightmap is basically right now.
It’s accurate to 1-2 inches at any height, although I still need to do stress testing.
It is a 256x256 “downscaled splatmap”. Drawn using one-texel thick lines perpendicular to road direction, 1/3rd texel apart, with nearest-to-centre texel overwrite.
It’s 1/4 resolution of the terrain heightmap so it’s not bad considering.
Road location, terrain painting, height map update at 7-10 FPS.