Population Mask question

Started by WAS, July 18, 2019, 08:03:52 PM

Previous topic - Next topic

WAS

Let's say we have a circle, and we want to use that as a point of where a pop object should spawn. How big must that circle be before TG recognizes it? I have circles repeating in a row, about 2 feet across or so, but the population won't place a single object using the image map as a density shader.

I'm trying to stick to real world scales but unsure why this isn't working. The mask is working, as if you invert it, you can get a population. Just it won't place any in the points indicated.

WAS

#1
Oop, I think I figured it out. The population spacing doesn't really relate to actual meters it looks like (or the alignment is off in 3d space). I had to use a much smaller spacing, 0.2, even though the points are meters apart. Issue is now they still aren't aligned right do the seed within the masked area. Wish there was a way to have the objects centered to space the occupy and their mask.

Matt

Object spacing is in metres. There might be some other cause of the misaligned textures. Make sure the thing generating the circle is a 2D circle function, not a 3D sphere, otherwise the Y position may fall outside the sphere.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

#3
Quote from: Matt on July 18, 2019, 11:22:08 PM
Object spacing is in metres. There might be some other cause of the misaligned textures. Make sure the thing generating the circle is a 2D circle function, not a 3D sphere, otherwise the Y position may fall outside the sphere.

It is a image map repeating one direction, than warped with a vector displacement fed a PF with no variance. The population has no variance either but can't get pops to align to the circles, and also some.of them.may not have a light instance generated at all. And you'd think a spacing of 0.5-1 would catch circles spaced evenly by at least 5 meters, not 0.1 with duplicates in the same place. I had to use 0.185 but some lamp spots are missing  and all sit randomly within the circle not centered despite no spacing variance.

The image map is scaled to 2.2m by 8.8m

I tried a smaller mask circle but had to go even smaller on my scale making stepping difficult to find a sweet spot, and still was down so small that almost every circle had 2/3 lamps blending together.

WAS

Here's a test render of where I'm at. I can either go from missing gaps, to doubles/triples. (notice lamp post far right). Alignment seems to be "ok" with this spacing setup, but not  centered.

This is all procedural shaders. Just using image based masks similar to Ulco's rail setup.

Matt

It might not be possible to do this without the occasional doubling up. You'd have to guarantee that your dots fall only on the exact grid points that the population generates, which might be mathematically impossible with a curved setup like this (that's just my intuition, I haven't studied it closely enough). Two possible solutions come to mind. 1: Do it without tiling; draw a grid of dots in photoshop and then erase the ones you don't want. Or 2: Accept some twins, triplets etc. and delete those instances. I'm not sure there is a better way yet.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

#6
Quote from: Matt on July 19, 2019, 12:16:19 AM
It might not be possible to do this without the occasional doubling up. You'd have to guarantee that your dots fall only on the exact grid points that the population generates, which might be mathematically impossible with a curved setup like this (that's just my intuition, I haven't studied it closely enough). Two possible solutions come to mind. 1: Do it without tiling; draw a grid of dots in photoshop and then erase the ones you don't want. Or 2: Accept some twins, triplets etc. and delete those instances. I'm not sure there is a better way yet.

There seems to be a better alignments with gaps, the only issue is the holes in the populations. It be handy for future populations updates to have a right-click "Add population instance..." (when population editing is active) context menu option. This would work only in the 3D/RTP preview and assign a new instance to the x,y,z select from right click from the preview.

This would probably be a better method of overcoming this, as I'm having issues with deleting the right instance when editing the population due to intersecting bounding boxes, and some times moving the camera even by 180 I'm hitting the same bounding box and have to swivel another 90 degrees. Just kinda make the workflow slow.

Thanks for your suggestions.

Dune

I've worked on this problem several times. In the early days, when editing wasn't possible it caused serious problems. Editing is best done with a non-box preview, as you better see what you're doing. And sometimes instances are not shown in box, but are in smooth shaded, e.g.
I often have to set up evenly spaced lines of trees along roads, and also got problems when the pop was attached to the ground, and angled. If at all possible (flat ground) a floating pop better aligns and doesn't miss instances. I wonder why that is, and whether it can be helped.

Btw. that pavement; does it only seem to bend with the warped angles, or is it? I mean the dividing , perpendicular lines. We've worked on that problem too, getting lines perpendicular to the direction of the warp bend with it, so to speak.

WAS

#8
Quote from: Dune on July 19, 2019, 01:58:13 AM
I've worked on this problem several times. In the early days, when editing wasn't possible it caused serious problems. Editing is best done with a non-box preview, as you better see what you're doing. And sometimes instances are not shown in box, but are in smooth shaded, e.g.
I often have to set up evenly spaced lines of trees along roads, and also got problems when the pop was attached to the ground, and angled. If at all possible (flat ground) a floating pop better aligns and doesn't miss instances. I wonder why that is, and whether it can be helped.

Btw. that pavement; does it only seem to bend with the warped angles, or is it? I mean the dividing , perpendicular lines. We've worked on that problem too, getting lines perpendicular to the direction of the warp bend with it, so to speak.

I honestly haven't looked too closely at that bend but it looks like the lines are somewhat perpendicular. Eve. With 0 variance, or noise adjustments, and uniform scales, and whether using a vector displacement or redirect shader, I cannot get smooth warps that maintain the dimensions of what's warped. Really a shame. For example despite the path mask being over twice as wide as the sidewalk, areas intersect onto the pathway, tilting it, or bringing the banks right up onto the sidewalk. The sidewalk width dimensions are also warped along same path.

And of course this problem is worse at curves, where I want my scene to take place lol.

I do notice image map repeats on Y for "Z"? Maybe that's why it has issues with 3D space and geometry. Matt mentioned Y causing issues?

I wonder if rotating a repeating X by Y 90 degrees to Z axis would help... it's late, thinking off top of my head. Will tinker tomorrow.