Page 1 of 1

Vegetation ZeoGraphs

PostPosted: Sat Mar 06, 2010 12:44 pm
by David Walters
Here is an example of a ZeoGraph that creates a mask heightfield. I'm using this to attenuate vegetation density between two altitudes.

This is a regular heightfield - the greys represent heights in meters from -63.35 to 537.62 m

Image

Here is the generated mask - it has values from zero to one representing a mask to modulate with a vegetation density.

Image


Here is the graph - there are two (probably badly named) 'constants' on it. TREELINE specifies the maximum altitude that any vegetation will grow, and PEAK ALTITUDE represents the highest point where all vegetation can grow. It generates a new map in your project called 'VEGMASK'

http://www.hiddenasbestos.com/share/VEGMASK.zgraph


It's quite simple, but I hope it is useful as a demo.

PostPosted: Sat Mar 06, 2010 1:52 pm
by David Walters
Finally, here's a more complex one.

http://www.hiddenasbestos.com/share/VEG.zgraph

The idea here is to create a simplistic density map (as in, with no real relation to actual botany) for vegetation. Starting from a noise base:

Image

We add the specular map (using the scalar product filter to get a luminosity) to bias growth on the 'sunny side' of the terrain.

Image

and the salinity map, raised to a power - to remove vegetation from underwater areas.

Image


Finally modulated with my mask from the previous post.

Image



The final result looks like this:

Image


In the future I might expand this to remove vegetation from rocks, etc. based on what additional vegetation support is added to L3DT in future.

PostPosted: Sun Mar 07, 2010 8:54 pm
by Telarus
Awesome stuff.

PostPosted: Mon Mar 08, 2010 9:34 am
by David Walters
Telarus wrote:Awesome stuff.

Thanks, it's fun to put these together :)

I'm half expecting (and hoping) this particular example will be redundant soon, when Aaron comes along with a better thought out system incorporating type assignments -- I'm glad that my example is helping to drum up a bit of support though.

I also thought this morning that maybe you could make a different graph for underwater plants like kelp and such - probably I'd just use the Salinity map directly instead of inverting it. You'd need a bit of a modulation on water depth too, to keep it out of the shallows.

PostPosted: Tue Mar 09, 2010 12:40 am
by demi
I must have missed this somewhere but I though this project was inactive for awhile. I wonder how this will work with my idea. Can this data be read from outside L3DT?

PostPosted: Tue Mar 09, 2010 9:57 am
by David Walters
demi wrote:I must have missed this somewhere but I though this project was inactive for awhile.

I think that Aaron recently mentioned this was an area he was looking into now. I for one am very keen as vegetation is the next thing I want to add to my terrain engine.

demi wrote:Can this data be read from outside L3DT?

Yeah, you can export the output of this graph to any file format that L3DT can write a normal heightfield to and use it in your own code.

I haven't though -- I don't have a vegetation renderer in place yet.

This is more of a theoretical exercise at this stage, and a demo of some potential things you can do in ZeoGraph.

PostPosted: Mon Mar 15, 2010 9:21 pm
by Aaron
Hi David,

Excellent work!

The only recommendation I would make would be not to use the salinity map, but instead to use the water depth from the water map. This would cover the case of freshwater lakes, which will have zero salinity and would therefore not properly mask the vegetation in your graph. However, this would require a few more filters, and it's probably not worth your while, as I am currently testing and algorithm to generate vegetation masks in just this manner.

At this time, I have L3DT generating vegetation masks based on the land altitude, gradient, water depth (inc. water table), and salinity. These masks are created as 8-bit mask map layers in the project, with one mask layer for each vegetation type. As the masks are stored in the project, you may modify them using ZeoGraph (to add random noise, or light map dependency, for instance). Since the masks are byte maps, we will require 'Heightfield.ConvertToByte' and 'ByteMap.ConvertToHF' ZeoGraph filters, which I will add presently.

The ultimate plan is to use the vegetation masks in a 'game of life' style simulation, as I think you suggested some time ago. The output of this would be a map of vegetation instances, which would then be used to render trees/grass in Sapphire or other rendering engines.

I'll let you know when I've got something ready to test.

Cheers,
Aaron.

PostPosted: Mon Mar 15, 2010 9:37 pm
by demi
Looking forward to this ^ :)

Demi

PostPosted: Tue Mar 16, 2010 9:32 am
by David Walters
Great stuff Aaron,

Thanks for pointing out the problem with the salinity map -- I think it was just corner cutting on my part, reusing that instead of trying out the new WM -> HF conversion filter. My test map doesn't have any lakes either so I definitely missed it!

It's great to hear about the work on vegetation masks, and having the tools to work with them in ZeoGraph is going to be great to apply application specific adjustments.

PostPosted: Thu Mar 18, 2010 10:02 am
by David Walters
Here's a quick show-and-tell of the vegetation I added to my terrain engine last night. I've never implemented this before, but I felt a bit guilty that I was talking about it so much but hadn't put my money where my mouth was. So, here are some screenshots - the terrains themselves were made with L3DT, naturally :)

Image

Image

Image

Currently it just uses a simple mask based on 'if ( slope < 30° && alt > 0 )' - I can hardly wait for when I can use 'proper' data based on land type, etc., this will really improve the obvious problems I'm having with green grass on sandy areas, etc. and remove the currently random selection of what type of plant to use.

PostPosted: Thu Mar 18, 2010 9:58 pm
by demi
Wow those look awesome. Nice job.

PostPosted: Sat Mar 20, 2010 1:03 pm
by Rummy
Excellent pictures. Wish I could achieve that with our old crappy engine.

PostPosted: Tue Mar 23, 2010 1:54 pm
by David Walters
demi wrote:Wow those look awesome. Nice job.

Rummy wrote:Excellent pictures. Wish I could achieve that with our old crappy engine.

Thanks very much for the kind words, much appreciated!