Author Topic: Scatter + Distance map insanely slow  (Read 226 times)

2025-01-14, 18:27:21

Jpjapers

  • Active Users
  • **
  • Posts: 1711
    • View Profile
I have about 100 trees on a landscape that are all proxies being displayed with a point cloud. Separate proxies for each tree, instanced.

I'm then using a distance map in a corona scatter with the trees assigned in the distance map. This distance map drivesthe scatter to add smaller plants around the trees, all of which are being displayed as boxes.

As a setup, its INSANELY slow but I don't entirely understand why. It takes about 15 minutes for the scatter to load into the scene. Any changes to the distance map take about 10-15 minutes to take effect. Even opening and closing the include/exclude list without making changes forces an entire reload of the scatter.

Its a little complex as far as scattering goes but i dont think it should be as slow as it is just to navigate the scene. I just tried importing a 700kb fbx and the entire of max locked up for over 90 minutes before i just had to quit yet it loads into a new scene absolutely fine.

Is there something inherently bad about this approach?

2025-01-14, 20:42:12
Reply #1

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5915
    • View Profile
If I remember right, CoronaDistance uses ray tracing to find the nearest point on the surface of an object it is taking the distance from - so you are asking Corona to raytrace to determine how far a given surface point on the landscape is from every surface point of every tree, or something like that in terms of calculations. That is a lot of calculations :)

Not sure what difference it would make, but you might want to have one distance map per tree, that way it's only calculating distance to that tree and not all trees (you could then add these together and pass the result to scatter to place the small plants). Another option, perhaps along with the first, would be to split the landscape into separate parts, so that each part is only calculating distance to a particular tree/particular trees.

EDIT - the above would really require the trees baked to geometry. Though you could use the second approach and divide up the landscape and each part has its own Scatter, that might reduce the load on the Distance map too as it won't have to consider tracing to every point of every tree in the scene for every point on the landscape.

Tom Grimes | chaos-corona.com
Product Manager | contact us

2025-01-14, 21:26:47
Reply #2

Jpjapers

  • Active Users
  • **
  • Posts: 1711
    • View Profile
I wonder if perhaps clone-and-align-ing  some non-renderable primitives where the trees are for use in the distance map would speed things up at all. Perhaps the tree mesh complexity combined with the probable need to load the proxies into ram for the distance map calculations is the cause of the slowdown?

2025-01-15, 11:54:37
Reply #3

aaouviz

  • Active Users
  • **
  • Posts: 972
    • View Profile
    • Another Angle 3D
I've also run into difficulties in circumstances like this and have opted to just manually add splines, or simple non-renderable objects (as you suggested) as a work-around.

It's not perfect, but depending on the level of detail and accuracy you need, it's probably a good solution.
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2025-01-15, 13:15:23
Reply #4

Jpjapers

  • Active Users
  • **
  • Posts: 1711
    • View Profile
Good to know, thank you. Ill give that a try. It should be fine for my needs.

Perhaps in future there could be a way to render the distance map to file, that way its not as computationally intensive especially if you dont need it to recalculate beyond its initial use.