TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
311 stars 15 forks source link

Shrinkwrap roads to terrain #144

Open TheDuckCow opened 7 months ago

TheDuckCow commented 7 months ago

Already being asked for by a few people, eventually it would be nice if we have a way to shrinkwrap the road to a terrain.

We need to think this feature out some more, but ideas so-far on requirements:

Technical ideation:

Expecting this would be a v1.0+ (ie Godot 4 only) feature.

dev-bre commented 6 months ago

is this going to allow the road to adjust itself to the terrain shape? I see that similar tools in unity and UE allow also the other way round.. the road changes the shape of the terrain below (raising the terrain to fill the space).

TokisanGames commented 5 months ago

For Terrain3D you can require the user to enable our full terrain collision in the editor. Or you can just detect if we're installed and query heights directly. https://terrain3d.readthedocs.io/en/latest/docs/integrating.html.

As for using raycasts to place your roads, running thousands of raycasts once in the editor, even if it takes a few seconds after a button push is not a concern.

TheDuckCow commented 5 months ago

Thanks for sharing the ideas! For sure @TokisanGames I'll be giving this a try once we wrap up/have a first stable godot 4 version. I definitely have the intention of integrating smoothly with as many terrain editors as is realistically feasible.

@dev-bre yup that is a common feature as well, but it the terrain engine itself needs to provide a way to do this. With at least one terrain dev I spoke with, they have a feature to input curves/paths which are used to define areas to smooth out and level the terrain. So as long as we can feed in the road generator's underlying curves through an appropriate callback, we'd be in good shape.