Jump to content

Procedurally generated road system (terrain material layers & decal)


Recommended Posts

Posted

Roads combined decals + terrain material layers (far away viewport)

image.thumb.png.962b31416128bd1f4ea442965b68483c.png
(I can only place every second decal as currently the ram explodes placing lots of decals)

Terrain materials only :
image.thumb.png.9e303de0596035756d2ecf091045a5f9.png

Again decal + terrain material close up, and ram requirements for 1000 road segments
image.thumb.png.4944bb94cf9133442e5504dcf7fc50c0.png

The algorithm is based on assigning each terrain pixel a tensor on a grid. 
Then, circular distortions are added, and "agents" walk in that field, representing a road, are simulated.
Each new startup, a completely new map is generated.
I have implemented this fully in c++, based on a video.
The full idea is based on information from this video to which I have nothing more to add : 

  algorithm The current leadwerks implementation is limited with a fixed terrain size, (no unlimited terrain) and high ram usage of decals.
Visually, the textures are tiling , and are missing normals, but this is a technical demo showing that such systems are possible within Leadwerks.
Once all decals are loaded, the performance is very good.
This is for a personal hobby project and if there is interest, I can release code after some issues are resolved.

  • Like 2
Posted

Road decal I used (dds file upload not working) 
road.thumb.png.ea58a96afbe65c984295a289d7afb706.png
Based on 

GROUND – Realistic & Artistic – Seamless for Tiling – Approx 300 images
Texture  by Eric Matyas
www.soundimage.org

 

Posted

To add to performance,
The base algorithm for the roads is very fast.
without decals, the generating and loading of the entire map takes 2-3 seconds. Adding decals increases that time by 10-20 seconds. 
I could write a LOD system for things to load based on camera distance.

Posted

Update on the decals issue; it seems to be an actual bug and not somethin gI have control over.

On the implementation side, the roads now are impainted into the heightmap as well. This existed before, but there was a coordinate mismatch

image.thumb.png.edb6ad948a1e3b04953c95d4c32c8ef1.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...