Clumping of vegatation...

Started by choronr, October 26, 2008, 11:30:17 PM

Previous topic - Next topic

choronr

A feature in object populations would be clumping of trees and etc. A settings under the .tgo settings wold be helpful.

bigben

Isn't that handled by the population's density shader?

Oshyan

Yes, exactly Ben. A "clumping" feature might be nice, but you generally get a lot more control with specific density shaders.

- Oshyan

gregsandor

Quote from: bigben on October 26, 2008, 11:59:24 PM
Isn't that handled by the population's density shader?

Not really; I have to set up two pupulations, one sparse, and one dense to control that.  Masks seem to read on or off.  If they could also intensify concentration at whitest points I could use one maks and distribution setup rather than two.

Oshyan

Quote from: gregsandor on October 27, 2008, 12:27:24 AM
Quote from: bigben on October 26, 2008, 11:59:24 PM
Isn't that handled by the population's density shader?

Not really; I have to set up two pupulations, one sparse, and one dense to control that.  Masks seem to read on or off.  If they could also intensify concentration at whitest points I could use one maks and distribution setup rather than two.
You can essentially do this. The maximum density will always be as you set it in the population's controls, but you can vary density from that point down to 0 by using grayscale density masks. So what you'd basically want to do is set a very high density, and then use masking to get your desired distribution and density in each area.

- Oshyan

gregsandor

I think that is what I'm doing with bigben's clip.  The functions measure the intensity of my Forest mask, and split it into three density masks.

bigben

Think of it in terms of the maths.  Density mask should be a BW image/PF (clamped to 0-1 for easier interpretation of the visual representation). The density of objects is thus mask density X object spacing.  To be useable, a PF mask should have a relatively large scale.  There's not much point having a minium scale of 0.1 is your object spacing is 10  

Another thing to consider is that unless your density mask has large areas of white (density =1), it may be necessary to decrease the object spacing to compensate for apparent reduction in overall density.  In my test forest in http://forums.planetside.co.uk/index.php?topic=5049.0 the object spacing was between 3-5 for the different populations, even though I would normally have set this to around 10 without a mask... or what Oshyan said  ;)

N810

would this be an instance where the cloud shader would be helpfull as a mask ?
Hmmm... wonder what this button does....

gregsandor

#8
What would be useful is two options in population masking:

As it is now darker areas of the map are just less likely to place a tree at that point.
Use mask, density evenly distributed across the mask.

Option:
Use mask, density at black 0, 0, 0 = 0/m density at grey 128,128,128 = 10/m , density at white 255,255, 255= 20/m and the shader interpolates a curve along the whole spectrum.

buzzzzz1

I'm hoping the new "Painter Shader" will take care of this when it comes out?  Isn't that basically what you guys are talking about?
XFX 750i SLI  nFORCE Mobo
Intel Core2 Duo E8400 3.00 GHz Wolfdale
8 Gig Corsair DDR2 6400
Nvidia GForce 9600 GSO 768 MB
XP Pro 64 bit OS

choronr

So do I; when developing a mask, you must take an orthographic shot of the terrain; draw the mask; and later find you missed the spot where you wanted the mask on your POV. The painter shader would be an easier way around to produce clumping ...maybe?

bigben

Quote from: gregsandor on October 27, 2008, 02:12:50 PM
What would be useful is two options in population masking:

As it is now darker areas of the map are just less likely to place a tree at that point.
Use mask, density evenly distributed across the mask.

No. It's not a probability, it's an adjusted density of objects

Quote from: gregsandor on October 27, 2008, 02:12:50 PM
Option:
Use mask, density at black 0, 0, 0 = 0/m density at grey 128,128,128 = 10/m , density at white 255,255, 255= 20/m and the shader interpolates a curve along the whole spectrum.

The object spacing is the distance between objects, not the density of objects.

Object spacing = 20m
White = 1 ... 20/1 = 20m spacing
Grey = 0.5 ... 20/0.5 = 40m spacing
Black = 0 ... 0/0.5 = infinntie spacing (no objects)

If you're area of grey is only 20m wide, then with an effective object spacing of 40m there's a chance that you won't have any trees at all in this area... This is why the scale of the mask (or it's contrast/gamma) is important and why you usually have to decrease the object spacing.  A colour adjust node on the mask can be very useful for tweaking the density across the range of mask values... particularly the gamma.  The other thing I find useful for image maps is to check Data is linear in the colour section of the image map node. This ensures a linear relationship between the "brightness" of the original image and the numerical value it represents.

gregsandor

I'm glad you mentioned checking linear.  Can you explain what that means please.

Oshyan

Greg, I don't think I fully understand your suggestion(s).

- Oshyan

Matt

#14
The populator creates a number of candidate instances, with the average spacing you specify, e.g. 10 metres). (It's not completely accurate to say that's the average spacing, but that's approximately what happens.) For each candidate instance, the density shader is evaluated at the candidate's location to determine the probability that the candidate will be accepted. If the density shader has a value of 0.5 then there is a 50% chance that the candidate will be accepted. If the density shader returns 0.1, then there is a 10% chance that the candidate will be accepted and a 90% chance that it will be rejected. The density shader doesn't actually control the spacing or density of the instances - but that happens as a natural consequence of changing the probability of acceptance of a large number of instance.

As an example: over a large area with a density shader of 0.5, if your original point spacing was 10 metres (in other words 0.01 objects per square metre), the density shader would reduce the density to 0.005 objects per square metre or increase the average spacing to about 14 metres (not 20 metres, because density is per square metre).

Even if the density is as low as 0.1, it will only increase your average spacing by a factor of about 3.16 (because 1 / 0.1 = 10, square root of 10 is approximate 3.16). So you might want to make dark parts of your density shader much darker than you intuitively expect.

Matt
Just because milk is white doesn't mean that clouds are made of milk.