Procedural generation of mesh roads.

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

Procedural generation of mesh roads.

Post by slapin »

Hi, all!
I have a polyline set as a set of Vector3s and a mesh. I need to duplicate mesh and tweak its UVs and indices to build
whole road lane to the length of the line and then bend it according to polyline segments directions (smoothly if possible.

I implemented this for various engines, so I know all the theory behind it but I need to know what can I use from Ogre to make the task easier.
The most optimal scenario for me would be if roads would be created on the go with lods and all, but I'm also fine with it being generated whole once
at startup. Additionally I'd be happy to know if another/better tech exists (i.e. decal roads) and I have no idea about it.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2204
Joined: Sun Mar 30, 2014 2:51 pm
x 1188

Re: Procedural generation of mesh roads.

Post by paroj »

did you see https://ogrecave.github.io/ogre-procedural/ ? It has an example for roads.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

Re: Procedural generation of mesh roads.

Post by slapin »

paroj wrote: Thu Jun 12, 2025 2:43 pm

did you see https://ogrecave.github.io/ogre-procedural/ ? It has an example for roads.

Checked that. OMG the library needs some love, at least whole cmake stuff needs to be rewritten...
It looks like the library can do quite powerful CSG stuff, but I don't see a way to convert normal meshes to procedural shapes and I will need another approach for roads and use good old vertex buffer mangling magic. However I think it is good enough for procedural buildings, at least for walls, windows and doors, Sims3-style. Thanks for advice!