Planetside Software Forums

General => Terragen Discussion => Topic started by: rossworx on May 03, 2014, 06:24:47 PM

Title: Population altitude setting T2
Post by: rossworx on May 03, 2014, 06:24:47 PM
I have never been able to figure out how to keep object populations out of water or inside particular areas defined by shader color settings. It may be perfectly obvious and I'm missing it, but applying "Use Density Shader" settings to those, with or without Inversion, doesn't seem to do it.
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 03, 2014, 08:57:36 PM
Post a 'failed' .tgd and one of us will figure out where you're off track and re-post a "repaired" one that you can look through and see where it's different...best way I've ever learned was this way. Use one of the free XFROG models so we all have the same model.
Title: Re: Population altitude setting T2
Post by: rossworx on May 04, 2014, 10:29:38 PM
Thank you for your offer. I put together a quick file to illustrate my problem, with few complexities to complicate matters. I put in two populations of the XFrog Sweet Birches, and under 'Use density shader' I put 'Surface Layer 01' which is the only shader I have that specifies minimum and maximum altitude parameters. If there are others I haven't found them.
Title: Re: Population altitude setting T2
Post by: Dune on May 05, 2014, 02:50:08 AM
You connected wrongly. Distribution should be called from a separate, independant shader, like a distribution shader.
Title: Re: Population altitude setting T2
Post by: N-drju on May 05, 2014, 04:25:34 AM
In the future you can just use distribution shader and check "minimum altitude" so that no objects appear below that particular boundary. Just figure out what is the maximum height of the water. It won't work that well however if you have multiple lakes on various heights. :-\ You'll need several more distribution shaders in such a case.

Else, you can paint a "paint shader" covering the whole area where your lake, river, whatever is. Then, plug this new "paint shader" into the "blending shader" node and check "invert blendshader" in the given object's dialogue box.
Title: Re: Population altitude setting T2
Post by: rossworx on May 08, 2014, 02:24:34 PM
Thank you for these replies. I finally figured out where to find a distribution shader, applied the minimum altitude to it, and discovered that it somehow already appeared in the "Use density shader" spot for both objects, which is convenient but unexpected. However, the ground turned white and the trees went wading in the water again. Okay, cut the coverage in the distribution shader to zero and the ground colors were restored, but the trees did not emerge from the lake. (There is  only one lake.) I tried re-populating, but the b-boxes didn't move. Next approach, removed objects, replaced with new -- just one set this time. They still went skinny dipping. I'm overlooking something. (I've never quite caught on to using the nodes diectly; I must learn... Maybe this is the time?)
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 08, 2014, 05:11:29 PM
First off a Distribution shader has to go through the blend by shader switch to work.
I copied and pasted the one you included to use for the population and set it so it would work(see the .tgd attached)
re: Surface and Distribution shaders...It's generally better to use only one as your distribution I find, and for me it's the Distribution shader through the Blend /Mask input.
I adjusted your .tgd to reflect good distribution methods for surface and objects and made the coverage and coverage area much larger/denser.
Title: Re: Population altitude setting T2
Post by: N-drju on May 09, 2014, 01:46:22 AM
Rossworx, what you still need to do I believe is to crank "Fuzzy zone" to 0 or some other one digit value. The fuzzy zone, as I understand it, is an additional area where instances or a shader will appear but at an increasingly lower density. Try reducing that if you haven't already.
Title: Re: Population altitude setting T2
Post by: jo on May 09, 2014, 02:15:08 AM
Hi,

I'm not entirely sure that the fuzzy zone is the answer, but there is some documentation about fuzzy zones here:

http://planetside.co.uk/wiki/index.php?title=Fuzzy_Zones

I'm not saying this is the solution here, just that as it was mentioned I would point people to the documentation for it.

Regards,

Jo
Title: Re: Population altitude setting T2
Post by: Dune on May 09, 2014, 02:44:44 AM
I thought I had given you an adjusted file (a few posts up), where the distribution shader was set to work, but your latetst non-working file is wrong again. Didn't you check that file out? Distribution shader should NOT be part of the chain!
Title: Re: Population altitude setting T2
Post by: Kadri on May 09, 2014, 03:36:18 AM
Quote from: jo on May 09, 2014, 02:15:08 AM
Hi,
I'm not entirely sure that the fuzzy zone is the answer, but there is some documentation about fuzzy zones here:
http://planetside.co.uk/wiki/index.php?title=Fuzzy_Zones
I'm not saying this is the solution here, just that as it was mentioned I would point people to the documentation for it.
Regards,
Jo

That is interesting Jo.
I thought the fuzzy zone was something in meters
and because it didn't acted so i used it mostly with trial and error.
Now it makes sense.
Wouldn't it better if there was a basic notice beside that option that that number isn't in meters?
Because all(?) other numbers are mostly in meter ?

Actually the best would be for me if Terragen would use only the option in meters directly if possible.
Especially as the default " Min alt fuzzy zone" number looks more confusing if i have understood what is written at all of course :)
Title: Re: Population altitude setting T2
Post by: N-drju on May 09, 2014, 03:49:30 AM
Gaaah!!! Maths! My eyezzzzz hurt! :'(

I also thought it was a metric system... :P

Jo, from my experience I can say that it made a difference. Basically it's in the way populations are created and organized. Zero fuzziness is what works for me in suchlike situations. I like this tool as a blender because it is very accurate.
Title: Re: Population altitude setting T2
Post by: bigben on May 09, 2014, 08:53:58 AM
A slight twist on Dune's solution. For populations it can be a bit tricky judging what a population will look like as you have the spacing specified in the population node and the density of the mask to take into consideration.  Throwing in a colour adjust shader can make it easy to fine tune the mask, and I usually connect the population distribution mask to a dedicated surface layer for previewing purposes. I usually group my masks as well. Makes it easier to combine masks for multiple populations e.g. exclude population A from population B's distribution

[attachurl=1]
Title: Re: Population altitude setting T2
Post by: archonforest on May 09, 2014, 09:55:44 AM
Damn...I was also thinking in meters about it...Thx a bunch Jo.
Title: Re: Population altitude setting T2
Post by: Dune on May 09, 2014, 10:27:49 AM
Yes, I too had a simplistic view of fuzzy zone as being half the amount of meters up and the same down of the height.
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 09, 2014, 10:49:37 AM
Quote from: Dune on May 09, 2014, 10:27:49 AM
Yes, I too had a simplistic view of fuzzy zone as being half the amount of meters up and the same down of the height.

That must be one WIKI I read and remembered, but I as well wondered why they (fuzzy zones) weren't in meters like all else terragen.
Title: Re: Population altitude setting T2
Post by: jo on May 09, 2014, 04:22:55 PM
Hi,

It is a bit of a confusing parameter. That's why I wrote the docs, when I really looked into it I realised it didn't work the way I thought either! I think the "times 5" rule of thumb is possibly the easiest way to make use of it. Multiple the fuzzy zone value by 5 and that will give you the distance in metres where the things are essentially fully opaque. It also helps to think of that curve getting steeper as the value gets smaller.

Regards,

Jo
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 09, 2014, 04:30:10 PM
Thanks Jo...formula entered into my TGbrain....
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 09, 2014, 05:29:45 PM
So,.... here's what I found...will let the image talk for me...strange behaviour for sure...that's a 100m ss shader btw
Title: Re: Population altitude setting T2
Post by: dandelO on May 09, 2014, 06:28:04 PM
I've always had the idea that slope fuzzy zone was in degrees and altitude was in metres. That a constraint = 45° with Fuzzy Zone = 5 would mean the full range was between 40°Min'-50°Max'. And that the altitude zone was based in metres, eg: 50m max' height, with Fuzzy Zone = 25, would mean full coverage at 25m and fading out towards zero, at the 50m point. Confusing.
Title: Re: Population altitude setting T2
Post by: jo on May 09, 2014, 06:41:39 PM
Hi dandelO,

I'm not 100% sure what the situation is with the slope fuzzy zone. I had meant to add information about that to the docs but I see I haven't. We'll try and address that before too long.

Regards,

Jo
Title: Re: Population altitude setting T2
Post by: Kadri on May 09, 2014, 07:06:02 PM

I recently tried the min and max fuzzy zone with negative numbers and didn't got what i wanted.
It changes very much if you try it. So i had to change the scene entirely.
Wish i had looked at the docs.

Interestingly nobody much complained including me.
I always thought i had done something wrong anywhere :)

Jo is it too hard to change it to a basic metric parameter ?

Title: Re: Population altitude setting T2
Post by: bobbystahr on May 09, 2014, 08:46:57 PM
Quote from: dandelO on May 09, 2014, 06:28:04 PM
I've always had the idea that slope fuzzy zone was in degrees and altitude was in metres. That a constraint = 45° with Fuzzy Zone = 5 would mean the full range was between 40°Min'-50°Max'. And that the altitude zone was based in metres, eg: 50m max' height, with Fuzzy Zone = 25, would mean full coverage at 25m and fading out towards zero, at the 50m point. Confusing.

that was what I thought as well man,,,,also why does only increasing the fuzzy zone raise the height? as in my previous post
Title: Re: Population altitude setting T2
Post by: Kadri on May 09, 2014, 09:40:52 PM
Quote from: bobbystahr on May 09, 2014, 08:46:57 PM
... why does only increasing the fuzzy zone raise the height? as in my previous post

As i understand it think about the Max and Min fuzzy zone as a horizontal bar.
The Max with 0 (zero) is a straight line. By putting bigger numbers in there the line gets fuzzier to the bottom.
The Min is the same but it gets fuzzier to the opposite side so to the top.

Basically with bigger numbers the underlying texture is more seen
and the horizontal line of the surface layer color vanishes slowly from top to bottom and from bottom to the top.


[attachimg=1]

Title: Re: Population altitude setting T2
Post by: bigben on May 09, 2014, 10:20:43 PM
Increasing the fuzziness doesn't increase the height. Think of it more like 2 consecutive adjustments. 1) It increases the width of the fuzziness and 2) it changes the contrast of the fuzzy zone mask. The first image shows a fuzzy zone of 200, with a pink contour in a separate shader showing the elevation limit. The second image has a colour adjust shader thrown in after the distribution node that effectively removes the fuzziness, showing that it does extend all the way back to the elevation limit, it's just so faint that you can't see it.

By using a combination of a distribution shader and a colour adjust shader you can achieve a wide range of altitude effects that may be a little easier to get what you're expecting.
Title: Re: Population altitude setting T2
Post by: Dune on May 10, 2014, 04:17:30 AM
That's an interesting addition, Bigben, one I didn't use yet, but very handy. I did use it with a (blue) smooth step and 2 constants, where the constants were the heights.

No matter how it works; a surface (or distribution) TEST shader at the end of the line will always be handy to test whatever you want, be it heights, fuzzies, angles or power fractal distributions.
Title: Re: Population altitude setting T2
Post by: Kadri on May 10, 2014, 11:07:38 AM
Quote from: bigben on May 09, 2014, 10:20:43 PM
Increasing the fuzziness doesn't increase the height...

Ben i know what you mean and you are kinda(!) right in that way.
But putting it in that way makes it especially for beginners a little more confusing if you ask me.
You are changing the fuzzines basically to 0 (Zero) ones again
that we are trying to understand to begin with
when used with bigger numbers then zero (i know you stated that yourself too in your post).

I am preparing some more detailed basic images to show more clearly what i already meant in my earlier post.
And no i don't say that i understand all what is going on.
I only try to show what i understand and try to get confirmation if i am right or wrong.


Title: Re: Population altitude setting T2
Post by: bigben on May 10, 2014, 12:35:01 PM
I can understand how it may be confusing, but it is an important to note that the fuzzy zone doesn't change the altitude limit of the shader, especially in this case where a non-zero value in the shader, no matter how small, could result in the placement of an object. If you adjusted the elevation and fuzzy width visually, you would risk getting objects placed below the desired altitude restriction.  My example was only intended to demonstrate that non-zero values in the fuzzy zone did indeed extend all the way to the limit set even though the resulting surface looked to be a long way off.
If you are going to explain this to people I would only use one restriction at a time to avoid overlapping fuzzy zones.

The 2 images below compare a fuzzy zone of 200 (left) with a linear gradient (right). 3 colour contours: Red = min altitude, green = min altitude + 200, blue = min altitude + 5x200
The first image has a linear gradient of 1000m (attached TGD), matching Jo's explanation of approx 5x fuzzy zone to reach an opacity of 1. The second has a linear gradient of 200m. According to the graph in the wiki, the fuzzy shader has an opacity ~65% at the point where the linear gradient reaches 100%.
Title: Re: Population altitude setting T2
Post by: Kadri on May 10, 2014, 02:08:23 PM
Quote from: bigben on May 10, 2014, 12:35:01 PM
...
My example was only intended to demonstrate that non-zero values in the fuzzy zone
did indeed extend all the way to the limit set even though the resulting surface looked to be a long way off.
...

Yes absolutely.

One part i didn't get before was why it behaved strange (especially with negative numbers).
Now we know better because it wasn't any metric parameter.

The other part for me was in which way the fuzzy zone expanded Ben.
I mostly think visually and if i can't transfer the parameters to a visually understandable way i use only trial and error.
And that isn't much a productive way to work.

Instead of posting 9 different images i am posting 1 animated GIF with 8 seconds duration between every picture.
I hope it is easy to watch.

But it is important that where i wrote "Opacity border" in the GIF it is only the kinda viewable fuzzy border.
As Ben said above the real border is still what is shown in the Max and Min altitude settings.


I want to make a test with negative numbers too but there is only really 1 think i am curious.
Because if you put a negative number in the fuzzy zone they go to the opposite side then here shown.
But with 2 negative numbers (in the max and min fuzzy zone together) only the underlying color shows up.
So no surface layer colour is shown at all in such a setup in my tests.


[attachimg=1]
Title: Re: Population altitude setting T2
Post by: Kadri on May 10, 2014, 10:11:20 PM

Using negative numbers in only the Min or Max altitude options doesn't get any surprise.
It is the same as in the above post only in the lower part of the Planet.


[attachimg=1]


[attachimg=2]




But using negative numbers in the Max and Min fuzzy zone options is different.


[attachimg=3]



* With even a small negative number in the Fuzzy zone like  -0.0001 you get a image like in "1" or "2"
   and it is the negative of using 0.0001 as you see in this picture below.

[attachimg=4]


* If you enable Min and Max altitude options together but with only one Fuzzy zone being negative
   you still get the same "1" or "2" picture depending in which Fuzzy zone (Min or Max) you used the negative number.

* The fuzzy zone goes in the opposite direction with bigger (smaller?) negative numbers.

*
  If you use negative numbers in both sides of the Fuzzy settings you don't get a Surface colour at all ( "3" ).

Title: Re: Population altitude setting T2
Post by: bigben on May 10, 2014, 11:48:58 PM
A lot of this has to do with the combination of masks.  The problem with your first explanation is that you are visually defining where the border of the "node colour opacity" is. In frame 5, for example, you have a fuzzy zone that is equal to the difference in the max/min altitudes (2,000 & 1,000) you use in the demo, and with a resulting border halfway between two (1,500). At this point the surface has an opacity around 65%. This isn't a bad visual approximation for a single fuzzy zone.

When you then define 2 fuzzy zones, they will interact with each other. In frame 9 of your animated GIF for example, the upper and lower fuzzy zones will have an opacity of 65% at 1,700 and 1,300.  But these 2 masks overlap and their combined effect reduces the opacity of the surface so that the "border" appears to be half way, but it's opacity will be less that 65%. 

The application of the fuzzy zone to negative altitudes doesn't appear to be quite right. It seems to be behaving as if the fuzzy zone is being shifted downwards rather than starting at the altitude restriction.

In you're example where you use negative numbers for both fuzzy zones, you shouldn't see any surface because one of the masks will always have a value of zero. 
Title: Re: Population altitude setting T2
Post by: Kadri on May 11, 2014, 12:33:42 AM

Not much to say Ben. I wanted to see and test extreme settings too.

Quote from: bigben on May 10, 2014, 11:48:58 PM
...
The application of the fuzzy zone to negative altitudes doesn't appear to be quite right.
It seems to be behaving as if the fuzzy zone is being shifted downwards rather than starting at the altitude restriction.
...

I am not sure about that too. But if i haven't missed anything the only difference was the negative number.
But considering what i knew before this thread i am quite happy with the results for now.
Especially as my brain got very fuzzy too at testing all those (and more) settings tonight :)
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 11, 2014, 12:56:15 AM
It still seems to me that in my tests the colour is rising with the fuzzy zone change/increases; the height does not change at all....
Title: Re: Population altitude setting T2
Post by: Dune on May 11, 2014, 02:44:39 AM
Interesting tests, Kadri (never enough testing done!), but I think negative numbers don't really serve a purpose here. In other shaders they surely do have their uses!
Title: Re: Population altitude setting T2
Post by: Kadri on May 11, 2014, 06:29:38 AM
Quote from: Dune on May 11, 2014, 02:44:39 AM
...but I think negative numbers don't really serve a purpose here. In other shaders they surely do have their uses!

Not sure which one you mean Ulco.
In one of them if you use only one fuzzy zone option it is easy to use as a negative mask.
After  i saw how little i know about this node i wanted to see it more detailed Ulco :)
Title: Re: Population altitude setting T2
Post by: Dune on May 11, 2014, 06:37:13 AM
Well, like in the noise variation of cloud fractals, or constants, or color adjusts, or smoothing option in surface shader...
Title: Re: Population altitude setting T2
Post by: rossworx on May 15, 2014, 02:10:58 PM
Thanks, everyone. BobbyStahr provided a solution (thanks!) which I'm still attempting to implement in new projects, not always with success. I try to allow a fuzzy zone that would let fewer trees (in this case) approach the shore of the water, by making the total of the zone and the 'hard edge' of the allowed area reach just above the water level. I'm also trying to get my head around some of the other posts here; but I'll keep working on this. Much appreciated -- and I'm glad my inquiry initiated some discussion!
Title: Re: Population altitude setting T2
Post by: bigben on May 15, 2014, 06:56:00 PM
The main thing you need to remember is that a mask/density shader for populations works with numbers. Just because you can't see any colour when you apply a mask to a surface shader doesn't mean that objects won't be placed there, and just because something looks white doesn't mean that the full density off objects will be placed. To be absolutely sure of not placing an object in a particular place you need to know that the mask will have a value of 0 at that point so, to be absolutely sure of not placing a tree in a lake you must start with a minimum altitude just above the water line.
Title: Re: Population altitude setting T2
Post by: bobbystahr on May 15, 2014, 07:41:02 PM
Quote from: rossworx on May 15, 2014, 02:10:58 PM
Thanks, everyone. BobbyStahr provided a solution (thanks!) which I'm still attempting to implement in new projects, not always with success. I try to allow a fuzzy zone that would let fewer trees (in this case) approach the shore of the water, by making the total of the zone and the 'hard edge' of the allowed area reach just above the water level. I'm also trying to get my head around some of the other posts here; but I'll keep working on this. Much appreciated -- and I'm glad my inquiry initiated some discussion!


My pleasure, happy it worked for you
Title: Re: Population altitude setting T2
Post by: Stranded on August 20, 2015, 04:56:45 PM
Quote from: bobbystahr on May 08, 2014, 05:11:29 PM
First off a Distribution shader has to go through the blend by shader switch to work.
I copied and pasted the one you included to use for the population and set it so it would work(see the .tgd attached)
re: Surface and Distribution shaders...It's generally better to use only one as your distribution I find, and for me it's the Distribution shader through the Blend /Mask input.
I adjusted your .tgd to reflect good distribution methods for surface and objects and made the coverage and coverage area much larger/denser.

Thank you bobbystahr. I know this is an old one but this post helped me tremendously get past an obstacle with object placement I was having!