Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] General Discussion => Topic started by: hughannes on 2019-04-30, 16:41:19

Title: Rendering Trees Efficiently
Post by: hughannes on 2019-04-30, 16:41:19
Quick question:
I noticed rendering a lot of trees in fore- and middle ground is quite slow.
Are other people experiencing the same? Why is that? If so, what are some of your tricks to speed up rendering?

Thanks in advance!
Title: Re: Rendering Trees Efficiently
Post by: Nejc Kilar on 2019-05-01, 14:59:29
There is an issue with Corona or C4D (not sure which, probably depends on how you look at it) and how alpha maps work. Try rendering a scene with alpha maps and then off and you'll see your render times quadruple (literally).

It goes without saying, 3ds Max doesn't have this issue.

Personally, if I may be totally honest, whenever there is a lot of foliage or alpha maps involved I rent 3ds Max for a month. The performance difference when rendering with alphas and without is like going from a quad core cpu to a 2990wx. It is unfortunately not ready for exterior production. That is my honest opinion, wrong or right :)

Here is an example:
https://www.dropbox.com/s/zsu5vfba5s21f0w/Alpha%20Maps.flv?dl=0
(The last 5 minutes are probably the most telling :) )
Title: Re: Rendering Trees Efficiently
Post by: hughannes on 2019-05-01, 16:46:54
Very interesting. Thank you nkilar for that.
At least now I know what to look for.
Title: Re: Rendering Trees Efficiently
Post by: Nejc Kilar on 2019-05-01, 16:56:33
Actually, Cinemike just suggested to me that maybe there are performance gains to gain if you use the Corona Bitmap to load in your alpha. Maybe it would be good to check that out.
Title: Re: Rendering Trees Efficiently
Post by: TomG on 2019-05-01, 17:21:15
And for pure on/off bitmaps (such as leafs), don't forget to enable Clip in the Opacity section of the CoronaMtl.
Title: Re: Rendering Trees Efficiently
Post by: hughannes on 2019-05-01, 22:10:35
Thanks for the suggestions guys. Will investigate.
Title: Re: Rendering Trees Efficiently
Post by: DBK on 2019-05-02, 09:30:28
There is an issue with Corona or C4D (not sure which, probably depends on how you look at it) and how alpha maps work. Try rendering a scene with alpha maps and then off and you'll see your render times quadruple (literally).

Oh wow, I opened a ticket about this issue a month ago and I'm still waiting for answers. At least I can stop worrying that something is wrong with my machine.

I will try the suggestions posted here. This thing is driving me nuts.

Thanks :)

Edit: Enabling Clip in the Opacity section of the CoronaMtl and/or put the alpha map in a Corona Bitmap changed nothing for me (using the file that I prepared when I submitted the ticket).
Title: Re: Rendering Trees Efficiently
Post by: katzenwaffe on 2019-05-02, 10:12:08
Using CoronaBitmap increases rendertimes in all my tests - so I never use it. My thought was it would make things faster - but nope. And the UV-tiling parameters does not work either, so pretty useless.

What DOES impact rendertimes is if I have scenes with heavy foilage (leaves, trees, grass) using alpha opacity maps - is that i make sure checking "Clip". More than halfed render times.

Also, using "None" in native c4d-filtering in Bitmap seems to gain speed.
Title: Re: Rendering Trees Efficiently
Post by: DBK on 2019-05-02, 14:01:45
What DOES impact rendertimes is if I have scenes with heavy foilage (leaves, trees, grass) using alpha opacity maps - is that i make sure checking "Clip". More than halfed render times.
Also, using "None" in native c4d-filtering in Bitmap seems to gain speed.
Thank you Katzenwaffe! Using "None" in filtering and checking "Clip" does help.
I tried your suggestions in one of my latest scenes that have a lot of foliage and it helped mitigate the issue.
In the file I've submitted for the ticket (a much simpler scene) I tried to use the Clip suggestion but without Using "None" in filtering and there was no improvement. Maybe the scene is too simple.
Anyway I really hope that the team can solve this issue.
Title: Re: Rendering Trees Efficiently
Post by: romullus on 2019-05-02, 14:38:36
I don't know how it's in C4D, but Corona for max has global opacity filtering switch, meaning that by default opacity maps are not filtered. Filtering opacity will be slow in any renderer. I believe that's the nature of raytracing.
Title: Re: Rendering Trees Efficiently
Post by: Nejc Kilar on 2019-05-06, 13:03:01
Just did a quick test and here are some of my impressions. Please treat these as impressions and not necessarily real proper tests.

Same HDRI rotation, same model, same materials, same VFB settings. The camera angle is slightly off, that is why I'm saying its not a proper test. Still, you'll see that the conclusion is the same regardless.

- Opacity maps noticeably reduce the speed in Corona for C4D.
- Opacity map sampling doesn't make much of a difference.
- Opacity map clipping (filter, clipping) doesn't make much a difference.


- Corona Bitmap does make a difference although the performance disparity between 3ds Max and C4D is quite large. Example scene needed 50 seconds to get to 12 passes in C4D and only 18 seconds in 3ds Max. The difference in ray performance is 10-7 million (3ds Max) versus 2.5-3.5 million (c4d).

Stats:

3ds Max with Opacity maps: 18 seconds (10-7 million rays)
C4D with Opacity maps (+Corona Bitmap): 50 seconds (2.5 - 3.5 million rays)
C4D with Opacity maps (without Corona Bitmap): No idea, takes too long. (Only 800k rays)

3ds Max without Opacity maps: ~11 million rays
C4D without Opacity maps: ~11 million rays

As a note, turning off opacity maps in 3ds Max nets about +1 million more rays cast, in C4D it boosts them up by about +8 million. To keep it simple, there is performance parity between the DCC applications if there are no opacity maps involved. As soon as they are, the C4D implementation hits a major brick wall.

Another funny thing I noticed is that there is visual difference in the VFB contrast / exposure levels even when using the same HDRI. Not sure why but I'm just putting it out there.

edit:
The VFB difference is actually due to 3ds Max's default color picker not being sRGB while in C4D it apparently is. Values match better (although not identical obviously) if one switches to 3ds Max + Corona Color Picker. Just a heads up! :)