Planetside Software Forums

General => Terragen Discussion => Topic started by: rupertbg on January 13, 2018, 09:01:04 PM

Title: Get population positions
Post by: rupertbg on January 13, 2018, 09:01:04 PM
Hello,

Is there a way to get the output from a population of all the members of the pops locations? As like a distribution map / shader or similar?
Title: Re: Get population positions
Post by: rupertbg on January 13, 2018, 09:01:41 PM
I want to get the base locations of all my trees to feed into another distribution
Title: Re: Get population positions
Post by: Hetzen on January 13, 2018, 09:27:39 PM
You should be able to use the same settings from one populator to another, as long as you keep the distribution tab values the same, as well as matching the random seed.
Title: Re: Get population positions
Post by: rupertbg on January 13, 2018, 10:47:40 PM
That works for a lot of things like textures. But in this case I would like to texture around the base of the locations of the trees within the distribution. The trees don't exist at every point in the shader used for the distribution, they are spaced within the distribution by the populator.
Title: Re: Get population positions
Post by: Dune on January 14, 2018, 02:07:40 AM
This has been asked a few years back I recall, but it's not possible, afaik. The only option would be to do it the other way round, but I admit that in a mask for texture around trees, not every space will be filed with trees, unless you dense them up or make a mask that's big and pixel precise.
Title: Re: Get population positions
Post by: cyphyr on January 14, 2018, 07:47:07 AM
This might work ...
Make your population object invisible but still casting shadows.
Place the sun vertically above your scene.
Place an orthographic camera above your population at the same coordinates.
Create a white ground surface.
Render.

This should create a white image with dark shadows where the trees are.
Save this into photoshop and edit to taste.

The image can then be re-projected using the orthographic camera (you'll need a new render camera) as a mask so you can have your desired texture underneath the trees.

Re-render the scene with the normal camera, sun re-positioned to a more natural position and the trees set to render (not invisible object).

As I say this will work in some circumstances but not for all.
Title: Re: Get population positions
Post by: luvsmuzik on January 14, 2018, 09:11:41 AM
If you initially assign your population density to an image alpha type mask, could you then use that mask with broadened edges for your texture mask.

Like, a crisp line for the trees, then second mask image for texture widens that line, overpainting original mask?

I suppose this would depend greatly on the size of the area you are populating. :)

I remember other programs you could create a mask right on your terrain bmp, I think you could do this with a ratio too, where if you just wanted one tree or whatever, you got one tree per dot. (Or I could be hallucinating) :)
Title: Re: Get population positions
Post by: rupertbg on January 15, 2018, 01:25:53 AM
Thanks guys! cyphyr that's some genius right there..! I think I'm going to try this out, at least for placement of undergrowth with fallen leaves, really neat way of making it somewhat repeatable and procedural.

I am surprised it's not easier.. since the coords have to be in there, it's just a matter of getting them out!
Title: Re: Get population positions
Post by: cyphyr on January 15, 2018, 03:31:48 AM
If you had a single undergrowth object (say a bunch of bushes, grasses and scattered leaves you had grouped in another program into a single object) then you would be able to use the same settings (identical) as for your forest and your undergrouth object would appear at the base of each tree.
However you are wanting an area around each tree position point and I think the math for that may be quite complex. Doing it by hand like above may actually be easier .
Title: Re: Get population positions
Post by: Dune on January 15, 2018, 03:59:46 AM
You can also use the grey edges of a soft mask for undergrowth, by using a color adjust; black up, to make the tree area, and another; white down, to make the surrounding mask.
Title: Re: Get population positions
Post by: Oshyan on January 21, 2018, 09:05:32 PM
Exporting population instance position directly is not currently possible, but something we intend to support in the future. If you just want to re-use the same positions in Terragen itself, you should be able to just copy the population, and maintain the seed value (and the same masks, if any, of course).

- Oshyan