Chaos Corona Forum

Chaos Scatter => [Scatter] I need help! => Topic started by: Torsten on 2015-09-30, 15:06:34

Title: [solved] Corona Scatter Exclude areas
Post by: Torsten on 2015-09-30, 15:06:34
Hey Guys,

I am wondering if it is possible to also set exclude areas in Corona Scatter? I have some concrete slabs where i don't want the plants to be scattered. As you can see, the grass is now intersecting the objects. I have different corona scatter systems, so i would like to set the exclusion on all of them.

Thanks!
Title: Re: Corona Scatter Exclude areas
Post by: maru on 2015-09-30, 15:08:53
You can either create a separate distribution object and make in non-renderable, or you can use density map to exclude that region.
Title: Re: Corona Scatter Exclude areas
Post by: Torsten on 2015-09-30, 15:20:03
Not sure if i understand what you mean. I attached an image of the scene. I would like to make a path towards the house. The plane is the surface i scattered alle the objects on. I would like to exclude the path between the red lines. How would you do this? I tried to paint in vertex color, but i am not sure how this works, and how to use this as an exclude map.

Thanks
Title: Re: Corona Scatter Exclude areas
Post by: maru on 2015-09-30, 15:36:02
Here are some images.

vertex paint:
add vertex paint modifier, paint white areas that will be used for scattering, paint black areas that will be clear, then put vertex color map in the cscatter density map

cutout:
delete some of the base object's vertices/faces put this object over the original base, make it non-renderable (object settings > renderable off)
Title: Re: Corona Scatter Exclude areas
Post by: Torsten on 2015-09-30, 16:19:17
Super! Thanks to your tip it worked, i got myself a path.
Title: Re: Corona Scatter Exclude areas
Post by: maru on 2015-09-30, 17:18:25
Great, you can also paint some details on the path so that:
a) the grass is not "cut off" but gradually becomes less dense - you can blur the edges of path for this, or feed vertex color map into color correction node and change gamma/pivot/gain
b) use the same/modified map as scale map, so that there are bigger and smaller grass clumps
Title: Re: Corona Scatter Exclude areas
Post by: Torsten on 2015-09-30, 17:37:52
Thanks for the tips!

unfortenately my grass patches are circles of 1 meter diameter. I think that is the reason the edges do not look that good. Don't know if blurring the edge of the vertex color helps for making the edge the way it looks now.

I am not too satisfied with how the edge looks at the moment. Maybe i need to put smaller grass clumps manually at the edge?
Title: Re: Corona Scatter Exclude areas
Post by: romullus on 2015-09-30, 19:31:59
You can create second scatter for smaller grass patches and then tweak density map's curves of that scatter.

Attaching max2011 scene for example.
Title: Re: Corona Scatter Exclude areas
Post by: Torsten on 2015-09-30, 19:58:43
Cool! I didn't know that technique, i will give it at try for the next test render.

Thanks!
Title: Re: Corona Scatter Exclude areas
Post by: rambambulli on 2015-10-01, 11:00:37
I was wondering, why not only use the small patches?
I have done some tests with Forest Pack and with Corona Scatter and I can't find a real difference in render times when using only small patches.

Small patches adopt better to terrain nuances work better with edges, color variation, and clustering of variations.

Am I overlooking something here?

Title: Re: Corona Scatter Exclude areas
Post by: romullus on 2015-10-01, 11:56:51
Well, one still can use small patches for main area and individual blades for edges :] I'm glad to hear that there's no significant differences between huge and humongous counts of instances.
Title: Re: Corona Scatter Exclude areas
Post by: maru on 2015-10-01, 12:16:03
Some time ago Ludvik explained to me that it is best to use as few instances as possible - so the most efficient would be to create big grass clumps. I am not sure how important it is, though, but I guess this should not make much difference unless you are scattering billions of high poly objects. So:

one high poly grass blade per proxy:
-small field = ok
-huge area = no no

lots of high poly grass blades per proxy = ok, unless it is impossible to use (for example edges like mentioned above)

lots of low poly blades per proxy = best (obiously); if possible, as above
Title: Re: Corona Scatter Exclude areas
Post by: Torsten on 2015-10-01, 13:39:37
So using the output maps on the Vertexcolor seems to do a good job. This is how the path looks like now. I have used large patches of grass for the main surface scatter, and used smaller patches (10% of the large patch) for the border/edges. This does a pretty good job.

The only problem i am having is the control over the width of the border. I can't seem to make it wider. I attached an image of romulus file where i put arrows for direction. I want to have control of how far from the border the objects are scattered. And it would also be nice if the scatter would be less dense further from the border. ( i painted how i think such a distribution would look like in graph).
Title: Re: Corona Scatter Exclude areas
Post by: romullus on 2015-10-01, 14:08:38
Small patches won't extend in areas where vertx colours are pure white. You have to add more information into vertex map, either by bluring existing vertex colours or adding grey colours manually with a brush.
Title: Re: Corona Scatter Exclude areas
Post by: Ondra on 2015-10-01, 14:23:47
Some time ago Ludvik explained to me that it is best to use as few instances as possible - so the most efficient would be to create big grass clumps. I am not sure how important it is, though, but I guess this should not make much difference unless you are scattering billions of high poly objects. So:

If you can afford to choose (which usually is not the case), when instancing/scattering, it is always best to minimize the higher of (number of instances, number of polygons in the instance). This is usually done by having approximately same number of instances as number of polygons. This will be the best compromise between speed and memory usage.
Title: Re: Corona Scatter Exclude areas
Post by: Torsten on 2015-10-01, 18:21:07
Yes, the problem was that the gradient between black and white was too small. I added a larger gradient edge, and now its much better.
Title: Re: Corona Scatter Exclude areas
Post by: romullus on 2015-10-01, 18:56:44
Now this looks really good.

If you can afford to choose (which usually is not the case), when instancing/scattering, it is always best to minimize the higher of (number of instances, number of polygons in the instance). This is usually done by having approximately same number of instances as number of polygons. This will be the best compromise between speed and memory usage.

Sorry to bother you, but this is not entirely clear to me. Are you saying that optimal way is to have single poly proxies for such scenario? Or i completely misinterpreted you?
Title: Re: Corona Scatter Exclude areas
Post by: rambambulli on 2015-10-01, 21:48:14
Hi Guys,

I made some tests. On this scale there seems to be no difference.
Here I assume that instancing a grass leaf or a teapot doesn't make a difference. I chose the teapot to show what I did. With grass leaf this is a lot harder to show :).

As far as I can see  (but I am no render engine expert) there is no real difference between the different size of patches.
I assumed in this test that a large patch of teapots (or grass) is 2 or 4 times as big as a small patch of 5 teapots (or grass). Filled with the same geometry and trying to achieve the same density of course.
I was amazed to see that my tests don't really show any difference in render time. And only the single teapot instanced increased the memory usage noticeably.
I tested the single teapot just to test it. When creating grass a single grass leaf is very unusable I think.

Ondra if I understand you right, you mean: instead of using 10 instances of 100 poly object or 100 instances of 10 poly objects, you better use 31 instances of a 31 poly object. Right?

I can also imagine the LOD option in Forest Pack can make a real difference. So I still use the smaller patch but with far less complicated geometry as the geometry is further away from the camera. This could be the ideal option to find a balance between polys and instances.

@tmiddelkoop sorry for hyjacking your thread :)
Title: Re: Corona Scatter Exclude areas
Post by: Ondra on 2015-10-01, 22:04:55
I know I should not talk about it, because it will almost surely get misinterpreted into some horrible advices, but whatever ;))

If you need to render 100 000 000 grass blades (for simplicity 1 blade = 1 polygon), obviously you dont want to do no instancing ( 1 * 100 000 000) - it would not fit into RAM.
You also dont want to scatter individual blade 100M times (100 000 000 * 1), the scatter would compute for ages (and then it would crash on RAM).
Ideally you want to do 10 000 blades 10 000 times. It will give you the lowest RAM consumption (which is calculated as 10 000 instances PLUS 10 000 polygons - so 20 000 units of RAM - in other examples it would be 100 000 000 instances + 1 polygon = 100 000 001 units of memory, or 1 instance + 100 000 000 polygons = again 100 000 001 units of memory). You will also get the lowest precomputation time (which is again rougly computed as number of polygons PLUS (+) number of instances, NOT TIMES (*)). You will also get reasonable speed (highest speed is usually when using no instancing at all, but we already established that is not practical).

Obviously this is not applicable for many situations (such as scattering cars/trees- you cannot replace 5 highpoly cars with 5 000 lowpoly ones ;)). For scenarios like 1000 poly/instances this does not matter at all. Also cost per instance might be bigger than cost per triangle, so maybe it is better to go for instance polycount = 3*instance count. Or maybe 10? Hard to say ;)
Title: Re: Corona Scatter Exclude areas
Post by: romullus on 2015-10-01, 23:31:08
Thank you very much for info!
Title: Re: Corona Scatter Exclude areas
Post by: rambambulli on 2015-10-02, 09:04:34
Ondra that's interesting!

Btw I hope nobody took my little test as an advice.
Especially not when they could turn in horrible results :).
I was just wondering and trying to understand how it works. Thanks for explaining.
Title: Re: Corona Scatter Exclude areas
Post by: maru on 2015-10-02, 11:47:31
btw, you can also use object paint from 3ds max ribbon to paint instances (proxies) by hand, it's pretty easy and fast
Title: Re: Corona Scatter Exclude areas
Post by: zchen on 2015-12-26, 20:20:45
Yay! Finally we have new MSI-200 rule :] Thanks!

Sorry to bump up an old thread.

I was just quickly going through this post when I saw your comment Romullus; what is this MSI-200 rule (of thumb I presume) that you are referring to? Until now, I've never questioned the default MSI-20...
Is there some cases that needs up MSI-200??

I must have missed an important thread somewhere..

Thanks!
Title: Re: [solved] Corona Scatter Exclude areas
Post by: romullus on 2015-12-26, 20:25:29
Default settings is fine. MSI200 is just a forum joke... a bad one :]

I'll edit my post to not confuse more people.