L3DT users' community
Large 3D terrain generator

How does l3dt do water?

Any and all chit-chat regarding L3DT.

How does l3dt do water?

Postby krama757 » Mon Dec 05, 2005 8:58 pm

I took aarons suggestion of using PnP in conunction with l3dt to make some nice landscapes.

PnP allows splatting of textures onto the landscape and this is very fun and good looking, but they havent implemented water yet. How would you suggest I do water? I was thinking of learning L3dt's methodology and trying to mimic it to paint in PnP.

Any ideas?
New member
Posts: 5
Joined: Sat Nov 26, 2005 9:14 am

Postby Aaron » Tue Dec 06, 2005 2:57 am

Edited to remove dopey question

I've only barely used PnP-TC, so I'm not sure if it gives the user the sort of low-level access needed to implement L3DT's water mapping approach. Below I have described the general implementation in L3DT, but I will have to leave it to others to work out how this might be shoehorned into PnP-TC.

As I'm sure you know, water in L3DT is handled in a separate 'water map', which is basically a 2nd heightfield with a few extra bytes/pixel for water-body ID and water type (which you can probably ignore). To flood a water body such as a lake or the sea, I set the 'seed' pixel in the water map to the desired waterlevel. I then test the 8 neighbouring pixels (N, NE, E, SE, etc) to see if the terrain height is below the waterlevel of the flood. If it is, the algorithm sets the waterlevel of the neighbouring water-map pixel to the flood waterlevel, and then repeats the test on that pixel's neighbours. A flood-fill algorithm (see http://en.wikipedia.org/wiki/Flood_fill) is used to repeat this process until no new pixels are added to the flood.

Does this (start to) answer your question?

User avatar
Site Admin
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

what is PnP-TC??

Postby DeathTwister » Thu Dec 15, 2005 12:51 pm

Hi All,

Hay I got a questain what is PnP-TC and can someone shoot me a link to it?

Is there a viewer that can see the terrain in a isometric Projection? OOh my partner said there is a viewer, guess I'll go download it, cool he even says it has source, how cool is that :lol: :lol: :lol:

User avatar
Dearly missed
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Return to General discussion

Who is online

Users browsing this forum: No registered users and 2 guests