How to prevent plant populations from showing up on water?

Started by choronr, August 19, 2008, 03:51:04 pm

Previous topic - Next topic


Does anyone have some ideas on how to prevent plants fron showing up on the water's surface?

old_blaggard - A great Terragen resource with models, contests, galleries, and forums.


Quite a few different ways to accomplish that.  The simplest would either be by restricting your population by altitude or slope, or you could mask out areas that your vegetation is applied (and not applied) using an image map shader.


Do you mean preventing reflections or preventing the plants from being seeded where you don't want them (i.e. where water is present)?
If it's the seeding issue then either OB's method or an image mask
if it's a reflection issue then disable visible to other rays checkbox on the object maker in the internal network of the plant you don't want to be reflected.
You'll still get the shadows but you can disable those by unchecking the cast shadows checkbox in the same place
Figured out how to do clicky signatures


August 19, 2008, 04:38:02 pm #4 Last Edit: August 19, 2008, 04:49:59 pm by Tangled-Universe
Hi Bob,

I just sent you an e-mail to answer your previous questions as well as this one.

I'll past a part of it below for everyone else who's interested:

Sometimes I also run into slightly unlogical problems with restricting populations and almost any time the solution is to choose another surface node to let the population "sit on". I just saw your message at the forum for restricting populations from the water.
The suggestion I made above might help, otherwise it is indeed a matter of setting the minimum altitude 0,5 metre above the water with a fuzzy zone of about 0,1 metre.
For restricting populations I always use a surface layer. I create this manually close to the "object" group. So NOT via the "..."-button inside the population node. If you do this it is placed internally and is not easily accessible for adjustements.
Just give the surface layer a simple name like "Trees Dist". Then go to your population and manually type "Trees Dist" in the field for the distribution shader. It will automatically be activated and connected. You can see this in your node-network.
Now give the surface layer a full white color (color = 1, instead of 0,5) and make the proper adjustments for heighth and slope in the tabs. You can then use a breakup shader for controlling the breakup.
Tip: create low octave breakup-fractals and stretch them about 3-5 times on either the X or Z axis. This gives very realistic distributions. The fun thing of the new surface shader is that you also have a blend-shader.
This is very useful because you can also use this for restricting your populations by distance. However, you can also use a distance shader as blendshader for the breakup-shader, with the same result. But I find it handy.



Thank you all.

I have used a distribution shader; but, since the plants are on almost a flat surface, the distribution shader altitude and slope height limitation settings does not provide the restricted area where I do not want the plants to appear (on the water).

I do not know a thing about 'masks' but have used image map shaders. If I use an image map shader, wouldn't it block out the water and provide some other image? And, once again, I would have to use a distribution shader which seems problematical as I mentioned above.

I mean that I want to prevent the plants from showing up on the water - only on the dry ground in the foreground of the scene.


Thank you Martin, I will work on this using your suggestions ...will get back to you later.


If the water is a Lake object, then it must be appearing only where the terrain drops below a particular water level, even if the terrain is fairly flat. You should therefore be able to use a distribution shader with a minimum altitude constraint to control the distribution of your plants. The minimum altitude should be the same as the water level in the Lake object. You will need to use a very low fuzzy zone (perhaps 0), however, if the terrain is very nearly flat.

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


Thanks Matt, I'll give this a try and get back to you.


Hi Matt,

First, when running the mouse over the terrain to determine the 'Y' altitude dimension, I find that it reads 1.059 km vertically from bottom up 45% towards the top; and then I get the same reading horizontally from left to right. I have been using a distribution shader since I added the plants. As you suggested, I set the minimum altitude to control the plants based on the same level as the level of the lake object which is 1076.4; and, no plants show up after populating. This included setting the fuzzy zone to '0' and tried up to 5.

Also, I deactivated the above and tried the slope setting. The minimum slope angle is set at 1.52 with a fuzzy setting at 0.01. After populating, I got three plants; two on the dry surface; one on the water. My coverage is set low because I wanted a minimum of plants on the beach. The plant in the water is close to the water's edge which may be ok. Perhaps I'll try more seeds to see what comes up.



Hi Matt and Oshyan,

Well, I finally was able to get a population (only three plants which is ok) in the foreground. However, a full render produces more errors (unknown errors in ray trace and bucket). See attached image. I guess I'll have to try rendering without them and see what happens.


Hi Matt and Oshyan,

I tried again rendering the scene after I deleted the small population in the foreground figuring it was the problem. Same results as the last render above. I'll try one more time by raising the clouds a bit perhaps getting some shadows on the hillside. If I uncheck the ray traced shadows in the render section, I will not have shadows. Beyond the next render, if I continue to have these results, I will scrap this project.


I believe the errors you're getting are from the raytracing system and may be caused by the water. Can you try simply disabling the water and see if the errors still occur? If that fixes it, try disabling everything *except* the water and the terrain. If the errors still occur, it will probably be useful if you can send us the scene for troubleshooting. We may be able to resolve some bugs with it.

- Oshyan


Thanks Oshyan. Will try those suggestions and keep you posted. In order to send the file, I would need to post it at MediaFire since the heightfield load is a 4097 x 4097 32 MB DEM file of Moonlight Peak.


Hello Oshyan,

Here are the results of your suggestions:

•   (1) After disabling the water, I started a render; and, before it got to the third GI buffer, I got the same error message as described earlier above - plus, a Runtime Error message.

        (2) This time I disabled the population and the five single objects (three 'XFrog' palm trees and two of 'lightning's' 3Bushes). I enabled the water and did another render. This time, almost the entire picture completed except one piece of the bottom buffer; and, received another error message reading: 'An unknown error occurred in a render thread.'

I have attached the .tgd file for your revue. Also, you may download the 'Moonlight Peak, CA' DEM file from my web site: . This file was used for the heightfield load in the image and is a 32MB, 4097 X 4097 size and can be found at the bottom of the download page.

Also, I used an image map file for the largest fake stones layer. This is attached to the e-mail I am sending to you. As mentioned regarding the vegetation, I used three single objects of the XFrog palm trees, one population of lightning's 3Bushes and two each of lightning's 3Bushes as single objects. You can determine which of these files were used by observing the .tgd file.

Remember also to address the issue I described earlier wherein a portion of the bottom of the preview window is lost after going to the 'node view' and returning to the preview window.

This image file is named 'Vista de Cielo'.