spimort / TerraBrush

MIT License
645 stars 23 forks source link

How to handle roads with curbs? #110

Open spimort opened 3 months ago

spimort commented 3 months ago

Discussed in https://github.com/spimort/TerraBrush/discussions/109

Originally posted by **Flynsarmy** May 29, 2024 One issue I've had with every terrain solution is difficulty in adding roads that cut into the terrain. Think a suburban neighbourhood that has roads with curbs. The road is cut about 10cm down into the terrain - it's the curb that's at roughly terrain height. ![image](https://github.com/spimort/TerraBrush/assets/334808/af11e899-9494-45c0-a564-167f3aecea07) There are a few ways this can be handled: 1) Make the road at terrain height and slope the path beside the road up to give the illusion the road is cut into the terrain: ![image](https://github.com/spimort/TerraBrush/assets/334808/bf0c3714-57bf-4f2f-8441-5aed8b660edb) Disadvantage is that it doesn't look quite right. 2) Add the road splines above the terrain then manually paint the terrain height below the road to hide it. Disadvantage is that this process is manual and when you change terrain height, the road won't move with it. 3) Adding the road updates a splatmap that is sent to the terrain shader that automatically lowers the terrain. This is probably the correct solution but no idea how to do it. Could we get some sort of road tool for this addon (or even a Roads addon that works alongside this tool) with this functionality? We've seen a million 'here is an empty field' terrains, but as it stands it's difficult to make any terrain set in the modern world.