Using Height Field to determine object placement density

Started by Tudor, February 05, 2016, 02:18:06 PM

Previous topic - Next topic

Tudor

Hello,
I have seen mention of this option but I haven't seen someone actually showing how to use a height field file to determine the placement and density of objects.
I assume this is super simple and I'm just missing the obvious.
Any help would be really appreciated.
Tudor

Oshyan

What do you mean by a "heightfield file"? A heightfield defines *height*, so the only things you would be able to use it for to determine object placement would be *height* or *slope*, both of which are handled in the Distribution Shader or Surface Layer nodes. Just use the Distribution Shader as the *Density* Shader for your population.

If you mean using an imported image, particularly some form of GIS imagery data like forest coverage or something, then that would be done with an Image Map Shader or Geog Image Map Shader, then used as the Density Shader for your Population.

- Oshyan

Dune

If you describe what you want to achieve it's easier to give some advice.

Tudor

Quote from: Dune on February 06, 2016, 02:36:35 AM
If you describe what you want to achieve it's easier to give some advice.

Thanks Dune for being willing to help.  Sorry it has taken me so long to respond.
I've run into three problems which I'm assuming are all solvable I just don't know how.  The one I initially described very poorly is essentially described as the red area shown in the attached image.  I want to make those areas bolders.  Is there a way to make the population affected area a non-regular shape?  Seems they come as rectangles (and water as circles) ...maybe mask it?  What I'd like to be able to do is export the red areas (which are at different elevations as a mask and have the stones populate those areas only.

The second problem I've run into is varying water levels.  If A & B (as labelled in the pic) are at different elevations with B being higher then A how do I fill both areas with the appropriate water level?  I thought I could mesh a few smaller ones together but the bottom of the image shows what happens when I do that... If I make B a huge circle then it will go right over top of A and they will end up the same level.  How do I solve this problem?

Sorry for the above book.
Any help would be greatly appreciated.

bobbystahr

Paint shaders as  masks in a Surface layers to mask your lakes would be the way I'd go.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

Bobby is right, you can mask your lake easily by a painted shader area. I've made you a little sample. And the rock populations can be distributed using the height restrictions in the distribution shader. Beware that in the preview you only see the cut-off lake in textured preview mode, as shown.
The default shader is used to set opacity for the lakes, only upper one for now, be sure to turn the color to black, so only the painted white area will be water. If you want to check out the painted shader, there's a button on top of the preview, where you can paint.
I used planes for lakes, but you have to uncheck shadows if you do.
I hope this helps.

bobbystahr

Hmmm, had a look and the top plane is reflecting in the lower one Ulco, see attached pic...any way around that? Had a thought to implement this in one of my scenes but that's a major drawback. I guess using a very small lake might work in that situation as it's round and could be moved so it doesn't stick out the terrain.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Tudor

I'm glad you caught this Bobby.
The landscape I'm working with is from GIS data so I can't just alter it so I'll have to find a way around this.
I wonder if it will seem if I tile the squares together across a lake?
I'll have to give that a go and see what happens.
Tudor

bobbystahr

#8
Quote from: tudor on February 13, 2016, 06:40:26 PM
I'm glad you caught this Bobby.
The landscape I'm working with is from GIS data so I can't just alter it so I'll have to find a way around this.
I wonder if it will seem if I tile the squares together across a lake?
I'll have to give that a go and see what happens.
Tudor

I got the lake to work in the example Dune supplied. Just a matter of moving it around and resizing till it fits without cutting out of the terrain. Here's a small test I did with it, zoomed to the top smaller lake and I couldn't resist putting Dune's grass on it...Based on your drawing a circular lake should be fittable.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Tudor

Sorry to keep bothering you guys but I'm really struggling to get a handle on Terragen's UI.
Why, outside of this particular scenario would I use a lake as an object vs. using a particular Water Lake object?
Not really clicking for me.
Sorry for asking the dumb questions.
Tudor

bobbystahr

Well it is the default and it comes with a Water shader attached when added to the list view. I use a scaled Displaceable Cube often for lakes, rivers, etc., but on anything but the lake you have to turn off Cast shadows or the water becomes opaque, but on the Lake object they're off by default. Also if you ever try going underwater it won't work as the water has no actual volume, it's all done with mirrors...well shaders actually.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

Indeed, it's just a matter of choice. The lake is an object (sort of spherical), plane is an object, cube also, and you can also use a sphere (object). These are all displacable as they are internal objects (like the planet), whereas an imported plane or sphere isn't .But keep the shadow in mind. You can of course reduce size and locate the lake or plane such that the shadow isn't there. I didn't pay attention to it, never rendered, just assembled.

Oshyan

The Lake object is basically just a convenience. It has some settings and functionality that are useful for typical lake scenarios, it is round, it conforms to the curvature of the planet (optionally) for really large lakes, and it has shadows disabled as others noted. But the reason it looks like "water" is simply due to the Water Shader it comes attached to by default. A Water Shader can be used to shade *any* object or even the ground (though you don't get transparency with the ground since there's nothing under it). So it's just a matter of choosing whether the characteristics of the Lake object serve your needs best, or whether some other object with a Water Shader would be better.

- Oshyan

Dune

BTW: if you uncheck visible to other rays, you can get rid of the shadow.

bobbystahr

Quote from: Dune on February 15, 2016, 03:01:52 AM
BTW: if you uncheck visible to other rays, you can get rid of the shadow.

D'oh...but of course...brain cramp here or I'da though of that.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist