Author Topic: How to optimize my scene to render faster?  (Read 2456 times)

2023-06-28, 08:39:47

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
Hi,

I render a simple scene, a small bathroom, which is basically a box with only one tiny window.
The lighting is made of a Corona Sun + Sky, and I added a rectangular Corona light in front of the window to help light coming in.

The render takes so long to clean the noise, which is understandable as I guess Corona has hard times cleaning all these rays bouncing in the room: there is very little direct illumination involved here, mostly indirect illumination.

Materials are pretty straight forward: basic stone tiles on the wall and the ground, with an average reflection.

It takes around 250 passes and 17 hours to render in 6000 x 5800 pixels on my Threadripper 3990X cpu with a noise threshold of 3%. It is really long: most images render in around 1 to 2 hours even in 6K.

I was wondering what can I do to speed up the rendering?

All advice and comments are welcome, thanks.

2023-06-28, 09:41:52
Reply #1

philipbonum

  • Active Users
  • **
  • Posts: 73
    • View Profile
That is some crazy render time indeed. I don't think it should be this slow, even in that scenario.
You should probably go the normal route of resetting everything and turning it back on one at a time.

So, make a copy of the scene.
Reset corona settings in the "scene" tab of Render Setup.
Turn off all lights, even environment.
As an extra step you could put override material as a simple grey material, and hide glass materials for now.
Check if scene renders black, and if it does(it should), start by turning on corona sun and sky(environment) and check render time (Should be fairly quick)

If the scene still renders slow there might be some deeper issues that maybe the Corona team can help with.
If the scene now renders fast, you can start by unhiding glass, next you can put more and more objects into the exclude tab in the mtl override, and finally turn on the last of the lights. If the scene starts to render slow at some point during testing, note when and try and find the culprit. Could be materials with weird settings, lightMtl with weird settings, displacement, could be you forgot to turn off "occlude other lights" on the lightplane in your window, etc. Only way to know for sure is to test.

2023-06-28, 10:02:34
Reply #2

aaouviz

  • Active Users
  • **
  • Posts: 899
    • View Profile
    • Another Angle 3D
Make sure you're using UHD or 4K for the secondary solver? (Not path tracing)

Make sure there is no caustics on, no materials with dispersion.

Otherwise, yep, go through it incrementally, or as the previous post describes.
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2023-06-28, 10:26:37
Reply #3

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
Thanks guys,

I followed the steps as described by philipbonum and started running into trouble when enabling the sun and environment map.

By 'trouble' I mean that, to my understanding, rendering 6000 x 5800 with grey material (IOR = 1.0, glossiness = 0.0) looks slower than what it should be. After 10mn the noise level is 7.70%, and the remaining rendering time to hit 3% is 54mn.

I also checked the secondary solver is set to UHD Cache. I didn't check whether caustics are on or off but I don't think it really matters because of the override material.

I'm wondering if this is due to Corona 10? I recently upgraded to v10. Plus I've noticed my renders look different with v10 than v9, weird things happen: shadows are blurrier when lighting a scene with an HDRI map, and general contrast of images are different.

2023-06-28, 10:36:04
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8887
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Check what is your rays per sample stats while rendering. If it's unusually high, in the region of 100+, it might indicate that something wrong is in your scene. It is best to look at this stat when rendering scene with full materials and not override, since complex materials are one of the major contributors to high rays per sample.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-06-28, 10:45:18
Reply #5

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
Thanks.
Out of curiosity I started a new scene from scratch: I modeled a simple box, put a Corona Sun and environment, an override material and hit render.

The same problem is happening: after 5mn of rendering (6000 px wide) the noise level is only 11% and the remaining time announced to hit a 3% noise level is 1hour ... something is wrong.

Too bad I didn't do this test when I was still on Corona 9.

2023-06-28, 10:46:28
Reply #6

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
Check what is your rays per sample stats while rendering. If it's unusually high, in the region of 100+, it might indicate that something wrong is in your scene. It is best to look at this stat when rendering scene with full materials and not override, since complex materials are one of the major contributors to high rays per sample.

Thanks. I never had a look at this setting before. It shows 30.2. So according to what you say it looks normal.

2023-06-28, 10:49:31
Reply #7

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8887
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Thanks. I never had a look at this setting before. It shows 30.2. So according to what you say it looks normal.

Are you looking at the original scene, or at the box test with grey material?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-06-28, 10:59:44
Reply #8

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
At the box test scene with grey mtl.

2023-06-28, 11:06:28
Reply #9

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8887
  • Let's move this topic, shall we?
    • View Profile
    • My Models
You need to look at the stats in the scene that has an issue, not in a test scene. I quickly made similar box scene with grey material and i get comparable result to your test, but about twice slower ( i don't have threadripper), i think there's nothing wrong with your test scene, so you need to focus on the original scene.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-06-28, 11:06:47
Reply #10

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
When I said I started from scratch, I opened a fresh new scene and merged the test box I did in the original scene.
As I said the announced render time was around 1 hour.

This time I really started from scratch, by modelling the box in the new scene: the rendering time is about twice faster with an estimated rendering time of 35mn.

I suspect that the problem maybe coming from the geometry of the original scene (imported FBX file).

But still: 35mn to render a box illuminated by a Corona sun/sky seems a bit too slow, especially with a 3990X.
That being said, I don't have this problem with exterior scenes: so maybe Corona is not good in this particular scenario of interior rendering with a tiny window?

2023-06-28, 11:11:36
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8887
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Of course interior scenes are much harder to render, simply because most of the lighting is indirect, especially in a scene like yours, where the only light source is a tiny window. And also 6K is quite large resolution, that's 27 millions pixels.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-06-28, 11:26:54
Reply #12

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
You need to look at the stats in the scene that has an issue, not in a test scene. I quickly made similar box scene with grey material and i get comparable result to your test, but about twice slower ( i don't have threadripper), i think there's nothing wrong with your test scene, so you need to focus on the original scene.

Thanks.

The Rays/sample in the original scene is around 32.

2023-06-28, 11:44:24
Reply #13

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8887
  • Let's move this topic, shall we?
    • View Profile
    • My Models
That's a very good number, meaning that there's probably nothing fundamentally wrong in your scene and it's likely that this lighting scenario is hard to compute by its nature. If you don't mind to fake a little bit, you can try to place big light plane directly behind the camera and aim it to the room, make its intensity low enough that it won't cast visible shadows, but big enough that its light would contribute quite significantly to the overall lighting. You can deactivate its visibility in reflections and refractions, so that it wouldn't change appearance of scene materials. If the light will change direct vs indirect ratio quite significantly, that could dramatically reduce render time. Another option, especially if you don't want to fake the lighting is to try to tweak render settings, since the scene is dominated by indirect lighting, you can try to increase GIvsAA parameter in render setup performance tab, so more samples would be dedicated to solve GI noise in each pass and you don't need to render so many passes overall and waste samples on AA which is clean enough long before noise target is reached.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-06-28, 12:52:56
Reply #14

Tom

  • Active Users
  • **
  • Posts: 256
    • View Profile
    • www
Thanks for the explanation romullus.

I did some tests: adding a light as you suggest doesn't lead to faster renderings in this case and tends to make the image a bit more flat, but it is something I will keep in mind as it may be useful in some scenarios.

I also tried different values for Sampling balance: again rendering times don't change. Actually, when increasing this value, it tends to increase rendering times slightly which is quite the opposite of what would be expected. I tried values between 16 and 48.

So I'm not sure why there's no change in the rendering times. I used a resolution of 640x618 pixels and a target noise level of 10%.
The fastest combination was sampling balance of 16 (1mn08s) and the slowest sampling balance of 48 (1mn32s).