Planetside Software Forums

General => Terragen Discussion => Topic started by: cyphyr on September 05, 2007, 01:10:50 PM

Title: Object populations on Displaced surfaces??
Post by: cyphyr on September 05, 2007, 01:10:50 PM
Hi Guys
I couldn't find this mentioned previously but I think it may have been covered so apologies if this is redundant.
I'm trying to place a population over a displaced terrain, specifically the tower in my canyon scene. I want the objects to be on flatter areas, no more than 45deg and not below about 200m. The best result I have got so far is by placing a Compute Terrain after the displacement shader and plugging that into the Object Populator (rather than the default of using the final Compute Terrain from the Terrain Nodes). This result although going in the right direction is not usable as you can see that many objects are on the under side of the overhangs and on the vertical sides (fig1). Is there a way of getting this to work or is it simply pushing the envelope too far? I can get a simple texture to sit where I want it (fig2) and stones (fig3) but not object populations. Also what does the "Gradient Patch Size" in "Compute Terrain" do? Maybe changing its value might increase its accuracy . . .
Thanks
Richard
Title: Re: Object populations on Displaced surfaces??
Post by: Buzzzzz on September 05, 2007, 01:22:20 PM
Try assigning your population to the very last shader in the shader group. The one just before attaching it to the planet surface shader input. Can't answer about the compute terrain. Sorry
Title: Re: Object populations on Displaced surfaces??
Post by: cyphyr on September 05, 2007, 01:41:17 PM
Do you mean making the population a child of a Surface Shader? Cant test atm, rendering...
Richard
Title: Re: Object populations on Displaced surfaces??
Post by: Buzzzzz on September 05, 2007, 01:58:16 PM
In other words in your populations settings, terrain tab, compute terrain is default. Next to compute terrain click and chose assign shader and select the last shader that's in the shaders group. If say surface shader_03 is the last layer before it attaches to the planet then thats the one you want to chose. Be careful as they my not be in order in the list that pops up. You will have to look for it. Sorry but I'm dumb as a fake stone when it comes to explaining these things.
Title: Re: Object populations on Displaced surfaces??
Post by: bobbystahr on September 05, 2007, 03:44:26 PM
Quote from: Buzzzzz on September 05, 2007, 01:58:16 PM
Sorry but I'm dumb as a fake stone when it comes to explaining these things.

heh heh heh...good one Buzzzzz.. ...
Title: Re: Object populations on Displaced surfaces??
Post by: Volker Harun on September 06, 2007, 08:41:13 AM
Dumbutright.
Title: Re: Object populations on Displaced surfaces??
Post by: NWsenior07 on September 06, 2007, 07:05:26 PM
The way I do it is to create a surface layer outside the rest of them, and hook that into the compute terrain then take your population and set the blendshader (if I remember right) to be the same as that surface layer you created. Then its just a matter of adjusting your slope and altitude limits. Though admitedly, I'm not sure if that will work for a displaced terrain, though it seems like it should as long as the surface layer is after the compute terrain.
Title: Re: Object populations on Displaced surfaces??
Post by: Buzzzzz on September 06, 2007, 07:26:15 PM
Please read this from Matt in reference to this problem especially the edit section. This is what I am trying to say in my last reply.


Quote from: Matt on April 06, 2007, 09:26:48 AM
Quote from: Harvey Birdman on April 04, 2007, 11:12:40 AM
One question regarding performance, if I may. Suppose I have several populations of plants, and have connected the output of the (default) ComputeTerrain node to the TerrainShader input on these populations. Is this going to cause the ComputeTerrain to re-evaluate for each connection, or will it just evaluate once and supply the common result to the various populations?

Unfortunately it will re-evaluate this for every populator you have it connected to. However, unless you have multiple objects in exactly the same locations, this would be necessary anyway, so in most typical situations it wouldn't be possible to optimise this without sacrificing accuracy.

EDIT: This is probably a good place to say that you don't have to use the Compute Terrain node as the input terrain for your populations. Any shader network can be used, and it's often better to use the very last shader that plugs into the planet. Misunderstanding this is probably one of the more common causes of populations not sitting correctly on the surface. However, whichever shader you use, you should make sure that the surface normal has been computed either by that shader or further up the chain, otherwise slope constraints won't work on your populations.

Matt

Title: Re: Object populations on Displaced surfaces??
Post by: cyphyr on September 06, 2007, 07:52:45 PM
Thanks guys. I'll try the "last shader" technique but I my displacements may be too much anyway. I'll post my results
Richard
Title: Re: Object populations on Displaced surfaces??
Post by: moodflow on September 06, 2007, 11:13:59 PM
Hi Cyphyr, I 've been working on an image where I had this same problem, and connecting the populations to the last shader solved the problem instantly. 
Title: Re: Object populations on Displaced surfaces??
Post by: cyphyr on September 07, 2007, 02:54:52 PM
Well I tried this "Last Shader" idea and it kinda works. In the image you can see some of the effects I'm after but a whole lot of undesirable elements. The population is set to "Displacement", my last shader, as its "Sit on terrain" and is distributed via a surface layer with a min height of 400 (200 fuzzy zone) and no Max height and a max slope of 20d degrees (no fuzzy zone). As you can clearly see there are areas that fall within these constraints but have no populations. I've tried with the slope constraints set to Final Normal, Terrain Normal and Planet/Object Normal. Final Normal (fig 5) and terrain Normal populate a small cluster on the top of the tower whilst Planet/Object Normal populates most of the sides as well (pretty sure I shouldn't be using the last one anyway).

Attached is the tgd file if any of you wizards fancy a go at it (you know who you are :D ) Just use your own model...

I'm just about giving up on this one. I don't think populations can go under overhangs, possibly because if they could you'd have two objects in the same vertical space or something like that. Anyone from PS care to chime in on this one :)

Richard
Title: Re: Object populations on Displaced surfaces??
Post by: moodflow on September 08, 2007, 01:51:50 PM
Man, thats cool!
Title: Re: Object populations on Displaced surfaces??
Post by: Buzzzzz on September 11, 2007, 04:54:11 PM
Quote from: Volker Harun on September 06, 2007, 08:41:13 AM
Dumbutright.

What's up with the Insult?
Title: Re: Object populations on Displaced surfaces??
Post by: rcallicotte on September 11, 2007, 04:58:10 PM
I'm guessing (with loads of reasoning behind it) that Volker was just going along with your own response about the Fake Rocks.  What you said was right, even if you think you're dumb about explaining stuff.  Volker probably doesn't think you're dumb.

I haven't seen you are dumb.  At all. 


Quote from: Buzzzzz on September 11, 2007, 04:54:11 PM
Quote from: Volker Harun on September 06, 2007, 08:41:13 AM
Dumbutright.

What's up with the Insult?
Title: Re: Object populations on Displaced surfaces??
Post by: Buzzzzz on September 11, 2007, 04:59:25 PM
Quote from: calico on September 11, 2007, 04:58:10 PM
I'm guessing (with loads of reasoning behind it) that Volker was just going along with your own response about the Fake Rocks.  What you said was right, even if you think you're dumb about explaining stuff.  Volker probably doesn't think you're dumb.

I haven't seen you are dumb.  At all. 


Quote from: Buzzzzz on September 11, 2007, 04:54:11 PM
Quote from: Volker Harun on September 06, 2007, 08:41:13 AM
Dumbutright.

What's up with the Insult?

Perhaps you should let him explain it.
Title: Re: Object populations on Displaced surfaces??
Post by: Matt on September 27, 2007, 07:40:16 PM
Populations can not go underneath overhangs very easily. The population is effectively stuck to the original (flat) surface and then the positions of the objects are displaced along with the surface. In some places this may result in objects growing on the underside of overhangs but they would then grow *into* the surface if you don't change the position parameters of the object.

Matt