TheDuckCow / godot-road-generator

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

Procedural intersections #121

Open TheDuckCow opened 10 months ago

TheDuckCow commented 10 months ago

The initial scope of the intersection support is going to be using pre-generated scenes/objects. That's a good first step, but we eventually want to have procedural intersections. This task is to represent this work.

TheDuckCow commented 10 months ago

While we are not tackling this just yet, I did come across this video noting that at 15:42 it shows some nice details of the basis of intersection generation:

Transcribing and extrapolating with my understanding:

TheDuckCow commented 9 months ago

Thanks to Kitten on our team, here's at least one example of someone talking about how to approach procedural intersections. I think in the end we'll use a composite of techniques, but getting all the references we can is a solid start

https://twitter.com/noio_games/status/1704891239244382240

TheDuckCow commented 1 month ago

Another demonstration of an approach as well as user visual interaction: https://www.youtube.com/watch?v=3O897gbyiBk

This one is interesting, as the actual intersection is much more implied for the user, rather than it being an explicit object type. They seem to have a singular (equivalent) concept of RoadPoint. The icky party is that it means you end up creating multiple overlapping RoadPoints which still belong to each segments. But it's interesting it gives you some chance to wiggle-connect.

Two other videos I want to read more into: intersection decals and this Houdini intersection solver. This last one gives some nice philosphy for how to think of the curves connecting the segments.

TheDuckCow commented 1 month ago

Another video I came across for Unreal for creating intersections using a more primitive approach, this one's interesting in a way because it's just making use of overlapping roads and then overriding the material at the end. Their process:

  1. Create the road going through
  2. Over-connect the roads to each other
  3. Create an "override" material for the specific sections being added (hm, a concept like this could be nice for RoadPoints too)
  4. The using decals they are then able to add lines back to the correct edges of the mesh

https://youtu.be/RCv3dFUjOf0?si=T9_Jh0wzFTuYDeqZ&t=760

I don't think the above is exactly what we'd want to do, but the approach of using layered materials to get the right edges could be interesting. It depends on a global detail texture being used, which is also something we would probably want to implement eventually anyways.

TheDuckCow commented 4 days ago

Another example asset/system, another video. See here this time a blender addon called "Next Street" that does quite a lot.