Population Restricting Woes

Started by ProjectX, May 01, 2007, 11:32:07 AM

Previous topic - Next topic

ProjectX

I've got a simple, 1 model population and I'm trying to restrict it so that it only appears above the water (sounds reasonable).

I plugged a distribution layer into it that only sits above the water, and hit a quick render, and the entire world is still covered in trees.

This happened to me recently when I was messing with more advanced object placement, and I thought then that there must be a problem with the node layout, but now I'm beginning to think that there might be a more fundamental problem with my method.

The weirdest thing is I've gotten them to work before, but they don't know.

I've attached the tgd for you.

helentr

I tried your file. It has some strange (for me) connections and the surface layer that you use for distribution is added to the previous surface layers and so is too bright - this explains the trees in the water. Then it is not connected to the planet, although above it are the other surface layers.
If you don't want its colors to show, you could uncheck "use color".
I would put this layer above all others and would not let its color to show.
I have some difficulty using altitude constraints in regular distribution layers with fractal terrains that have negative height values - maybe that is why you used a surface layer?
Anyway, I attach an example file that seems to work (once you edit the object path and name), much simpler than yours.

Helen

ProjectX

#2
Ok thanks, yeah, the reason it wasnt plugged into the planet was that I didn't want the colours to show, I assumed it wouldn't need to be plugged into the planet, thanks for that tip!

EDIT: Made my modifications so it's like yours and... it still doesn't work.

I can't for the life of me see where I'm going wrong. I've re-added the population and the surface layer three times now, and everything seems to be set up right...

Here's the latest tgd.

I bet it's something blatantly obvious.

sonshine777

Here is what I came up with. When I ran the mouse along the shoreline it was giving me "Y" elevations ranging from -312 to -360. I didn't have the .obj birch you used so I did a new population using the same birch only in a .tgo format. I used a distribution shader and plugged in a "Y" elevation of -345 with 2 for the fuzzy zone. The trees seem to follow the shore pretty well now. Hope this helps. :)

I have attached the edited .tgd for you to use.

ProjectX

#4
odd... the lake is at 100 in height, and all the surface layers are based off of that.

Thanks for that one sonshine!

EDIT: y'know, when I set that up in the same way, using my surface layer05 it still didn't work! But your distribution shader did, so thanks for that! I wonder why the surface layer method wasn't working.

sonshine777

I have found that for populations of object that the surface shader doesn't always work,(sometimes it does work) the distribution shader however  is more consistent in population control. :)

Buzzzzz

Agree with sonshine777, I always assign a distribution shader to my populations to control Slope and Hgt restrictions. Works great for me. :)

ProjectX

Ok, will do from now on, thanks for the help!

Oshyan

A Surface Layer outputs color which varies depending on the color value chosen in its settings and on whether Apply Color is enabled. A blend or distribution shader input reads color values to determine distribution where white = full distribution and black = no distribution. So for example if you have a gray color in your Surface Layer you will not get appropriate distribution for altitude or slope constraints when input into the distribution port of another node because the maximum output of the Surface Layer is gray, not white - distribution will always be partial. This happens with any non-white color in a Surface Layer because anything that's not pure white will tend to be a variation with lesser absolute brightness, thus affecting expected distribution. This is why it's generally better to use a Distribution Shader if all you want is height/slope constraint.

- Oshyan

ProjectX

Ahh, I see, calico mentioned something along the lines of that. Thanks for the explanation!

rcallicotte

I did?  Oh my gosh.  I don't remember.  I didn't remember knowing this.  Is it coming out my ears, since I'm learning so much? 

Glad I know this now.   ;D
So this is Disney World.  Can we live here?

mr-miley

I've had problems using distribution shaders for populations before.... The shader does what it should do and restricts slope and elevation, the only problem being that the elevation is sometimes not acurate, like you with your water at 100m yet your trees (set to above 100m) still populate in the water. It seems that sometimes water levels aren't quite what they seem in relation to the rest of the landscape. Its not too much of a problem, just takes a lot of fiddling to find out what level the water (or whatever other shader you are trying to match to) is ACTUALLY at. This doesn't seem to happen with every scene. I am sure I remember someone (maybe Oshyan) saying It was something to do with the distance from the camera and the earths curvature????
I love the smell of caffine in the morning

rcallicotte

mr-miley, I've seen the same problem with the distribution shader and water levels.
So this is Disney World.  Can we live here?

mr-miley

Praise de lord, its not just me  ;D
I love the smell of caffine in the morning

bigben

I zoomed into the the preview where some of your trees are on the water found that the altitude is listed between -341 and -340, which is technically above your minimum.

I normally create a surface layer to preview the distribution shader first. Attached is a pink surface preview.  Note that in the screengrab the pink goes into the water.

If you uncheck Use Y and set the minimum altitude to 1m above the water this fixes the mask, but repopulating generates 0 trees.  You might want to try raising your terrain up to positive Y altitudes.