Planetside Software Forums

General => Terragen Discussion => Topic started by: bigben on October 25, 2008, 10:11:49 PM

Title: Masking tree populations by age
Post by: bigben on October 25, 2008, 10:11:49 PM
This topic started off as a tangent thread in my Growing Leaves post.  http://forums.planetside.co.uk/index.php?topic=5048.msg52231#msg52231 (http://forums.planetside.co.uk/index.php?topic=5048.msg52231#msg52231)

I've restarted it here to  avoid possible confusion between the two topics..

The "problem" is to distribute 3 different tree models of varying age in a relatively realistic manner.  The attached mask demo produces 3 variations of an overall tree distribution for the 3 age groups of trees. It's based on a very loose assumption that older trees will be at a higher density in the centre of the forest, and young trees will be at a higher density at the edges of a forest.

My first test render is actually over a forest as I only previewed the distribution of the old trees.  As it turns out, what I thought would be a field is actually a region of medium-aged trees, with older trees to the left and right.

I'm running another test render showing the edge of a forest
Title: Re: Masking tree populations by age
Post by: gregsandor on October 25, 2008, 11:19:38 PM
Here it is with 3 separate populations each distributed with the clip you set up. 

Bright yellow-green represents young trees, scaled smallest.  Mid green is mature trees, and dark green is old trees.
Title: Re: Masking tree populations by age
Post by: bigben on October 26, 2008, 12:21:20 AM
Here's my last test.  Note this is a very simplified version of the masking model but you can get the general idea. Particularly on the right hand side
Title: Re: Masking tree populations by age
Post by: gregsandor on October 26, 2008, 12:23:45 AM
Looks great.  Is that with the node setup you posted?  Thanks for your help with this.
Title: Re: Masking tree populations by age
Post by: bigben on October 26, 2008, 12:29:07 AM
That's using the same TGD I posted, with a fractal terrain added.

What you may want to try is working on each population individually at first. Adjust the masks/ object spacing until you get the kind of distribution you want... looking at the maximum tree density in particular.  The put the 3 of them together to see what it looks like.

Looking at fairly linear groups of trees may make things a little difficult. You may want to do this in an area where you have a large body of trees.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 26, 2008, 12:36:30 AM
I'm pleased with that result, and now am moving the test clip over to my main Glenfinnan file.  I think the only change I'll make will be to add altitude and slope distribution.  There are some areas of dense forest, but they are distant.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 26, 2008, 12:51:26 AM
Here's the node setup:

Is there any way to use one object file to feed each of these sections?  I think not since each is scaled and textured differently.  It seems it would be more efficient to use the same geometry only once and send it to be scaled and textured independently.
Title: Re: Masking tree populations by age
Post by: bigben on October 26, 2008, 01:03:25 AM
You'd need separate objects for each pop'n/ unique texture.

Looks like an interesting project
Title: Re: Masking tree populations by age
Post by: gregsandor on October 26, 2008, 02:28:05 AM
The forest is now in the main file.  The terrain textures match each of the leaf textures.  To use the clip file change the texture references and objects to your own, connect the populators to the Compute Terrain node and Planet, and link the Young Trees, Mature Trees, and Old Trees surface shaders into your terrain shading network.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 26, 2008, 04:33:52 AM
Now more than 100,000 trees.  Is there a log that shows the number in a population?  I see the populator count, but it runs fast and I can't always get a good read.
Title: Re: Masking tree populations by age
Post by: rcallicotte on October 26, 2008, 11:25:35 AM
What a cool thread.  Thank you for letting us in on your research.
Title: Re: Masking tree populations by age
Post by: bigben on October 26, 2008, 06:59:03 PM
You can pipe the output of TGDCLI.exe to a text file to give you a running log. Just checked my work computer and it seems it also works with TGD.exe (did this by accident by editing tgdNo3DPreviewNoNetworkView.bat which I needed for starting a render via remote desktop)

%TERRAGEN_PATH%\tgd.exe > %TERRAGEN_PATH%\tgdlog.txt

Creates a log file in the same directory as your TG application.
Title: Re: Masking tree populations by age
Post by: Oshyan on October 26, 2008, 08:27:31 PM
Or if you just run TG from the CLI exe you'll get a window with the log output where you can reference the population counts.

- Oshyan
Title: Re: Masking tree populations by age
Post by: bigben on October 26, 2008, 11:05:07 PM
I prefer to pipe it to a log file in case it crashes  ;)  In the case of multiple populations this can be helpful in seeing possible memory issues if it does crash, and finding the specific culprit.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 26, 2008, 11:16:35 PM
Thanks.  I set that up through the render dialogue, right?

Here's the latest incarnation of the terrain.  I modified the tree density system to also control grasses.
Title: Re: Masking tree populations by age
Post by: bigben on October 27, 2008, 12:09:00 AM
It's coming along well.

I'm not too sure about the stripes of "grass" in the foreground. It looks a little odd to me. Using the tree populations density shader to provide a mask for different grass under the trees is a good idea.  The scale still looks a little odd although the bridge obviously fits the terrain where it's supposed to be.  Maybe the tree desnity is a little low?... or perhaps some other detail along the shore might help provide a better sense of scale?

The distant hills are looking nice.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 27, 2008, 12:20:39 AM
I like the way the background hills look, and agree about the foreground.  The trick will be to get the near stuff looking nice and retain what I like about the distant mountain cover.

What we have now is the low-density tree mask.  I've just made a high density one: same way, by tracing the orthophotos.  That will contain the heaviest concentrations of trees.  Setting that up after I brew a pot of coffee...

The grass distribution is a copy of the tree dist, using a world-machine generated Rivers mask.  Heres a test shot before I put the textures in.  Red will be darkest grass, Yellow, mid, and blue, lightest.  This render is before restricting by slope or altitude.

Now for the heavy forests...
Title: Re: Masking tree populations by age
Post by: bigben on October 27, 2008, 02:04:25 AM
Flow maps can be very effective, even if used subtely. You might also want ot combine them with some other variations (e.g. interaction with tree density) to provide a bit more variation. Combined woth your slope variations this should produce a very nice image.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 27, 2008, 02:06:50 AM
What kind of interaction with the forest density?
Title: Re: Masking tree populations by age
Post by: bigben on October 27, 2008, 02:14:17 AM
e.g. add a % of the old tree mask to the dark grass mask to increase the amount of dark grass around the trees independent of whatever is happening with the grass mask.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 27, 2008, 02:29:25 AM
Ahh, okay. 
Here's the current state with the new Dense Forest layers visible in upper left and right (populations of Young, Mature, Old with increased densities, using the DenseForest masks.
Title: Re: Masking tree populations by age
Post by: bigben on October 27, 2008, 07:05:55 PM
The other thing to consider is the resolution of your mask image in relation to your terrain.  The antialiasing in TG will reduce the density across much of a low resolution image. You should use a resolution where the smallest detail you want to retain is 2 pixels wide in your image.  Even then, you may want to use a colour adjust shader to increase the contrast slightly to get your values up where you expect them to be.  Most of my masks are at least 10m/pixel for close up work derived from landsat imagery, or 30m/pixel from USGS canopy data.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 27, 2008, 08:01:04 PM
The mask for the 23040 m terrain is 2048 x 2048, as is the one for the 2565 m terrain.  This gives resolution of 11.25m/px for the 90m dem, and 1.25 m/px for the 5m dem. 
Title: Re: Masking tree populations by age
Post by: bigben on October 28, 2008, 04:27:48 PM
At 1.25m/pixel you could turn off antialiasing for the mask image for the population.

Another interesting thing to try would be to use a 2 pixel wide brush to place white dots where you want trees (on a black background) and try an object spacing somewhere around 4. You might be able to "place" individual trees reasonably close to where you want them.  Haven't tried it myself but it would be an interesting experiment.
Title: Re: Masking tree populations by age
Post by: gregsandor on October 28, 2008, 04:32:32 PM
Is the antialiasing option in the image map dialogue?

I have used the method you describe.  I'll see if I can find an example for you.  It works.
Title: Re: Masking tree populations by age
Post by: bigben on October 28, 2008, 04:44:20 PM
Quote from: gregsandor on October 28, 2008, 04:32:32 PM
Is the antialiasing option in the image map dialogue?

Yes.  In the colour section
Title: Re: Masking tree populations by age
Post by: gregsandor on October 28, 2008, 05:12:32 PM
This is Augusta County, Virginia.  In the high-res orthophoto I located the bases of all the telephone poles (look for the end of the shadow) and placed a dot, then used the processed result to mask the population.