Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Jpjapers on 2023-05-04, 16:34:51

Title: Tracking down the cause of a slowdown
Post by: Jpjapers on 2023-05-04, 16:34:51
Hi all,

I have a huge scene im working on and after merging an object from another file, rendering has slowed to a crawl with five minute parsing times 5 minute UHD cache times and rays/s under 200k.
I cant figure out what is causing the issue as the object im merging in, is fine when rendering in its original file and has no immediately obvious issues.

I was wondering if anyone had any tips and tricks they use for tracking down the causes of slow renders whether it be rogue objects or complex shaders.
If any of the devs have tips on what they do when assesing out scenes that would be really useful to know too!
Title: Re: Tracking down the cause of a slowdown
Post by: TomG on 2023-05-04, 16:55:48
In general, hide half the objects and render. Still slow? Hide half again and repeat. If faster on the first halving, switch which half is hidden and continue as before. This should identify objects or materials, and once you pin it down, you can investigate why.

You could use material overrides too, usually worth enabling that globally and see if magically everything gets faster as then you're most likely looking for a problem material. You can still likely track it down with the steps above (probably easier than using exclusions to the material override).
Title: Re: Tracking down the cause of a slowdown
Post by: maru on 2023-05-04, 17:15:47
Exactly what Tom said, or start a new empty scene, then start merging your objects one by one (or first half, then half of the remaining objects, and so on until the slowdown appears).

But since you mentioned the slowdown appears after merging a single object ("after merging an object from another file, rendering has slowed to a crawl") - then I guess that object is the culprit and the remaining part of the investigation is to figure out why it's slowing down.
Is that object related to some 3rd party plugin?
Is it using a complex material and/or a material using 3rd party plugins?
Title: Re: Tracking down the cause of a slowdown
Post by: Jpjapers on 2023-05-04, 17:25:23
Exactly what Tom said, or start a new empty scene, then start merging your objects one by one (or first half, then half of the remaining objects, and so on until the slowdown appears).

But since you mentioned the slowdown appears after merging a single object ("after merging an object from another file, rendering has slowed to a crawl") - then I guess that object is the culprit and the remaining part of the investigation is to figure out why it's slowing down.
Is that object related to some 3rd party plugin?
Is it using a complex material and/or a material using 3rd party plugins?

It could be a bit of column A and a bit of column B.
It has a railclone object in it thats gernerating lots of lights. However, the same number of lights when created manually doesnt cause the slowdown it would seem.
So i think it could be railclone, lights and material complexity coming together into a perfect storm.

I think ill put ijn some hours this evening and strip back the file.

One thing i have noticed though is that even when i hide the imported objects, the slow rendertime stays there.
If i dont import it, the scene renders fine.
Title: Re: Tracking down the cause of a slowdown
Post by: Jpjapers on 2023-05-04, 17:27:47
In general, hide half the objects and render. Still slow? Hide half again and repeat. If faster on the first halving, switch which half is hidden and continue as before. This should identify objects or materials, and once you pin it down, you can investigate why.

You could use material overrides too, usually worth enabling that globally and see if magically everything gets faster as then you're most likely looking for a problem material. You can still likely track it down with the steps above (probably easier than using exclusions to the material override).

Material override isnt something ive considered before so thats a good one to try early on thanks Tom.
Title: Re: Tracking down the cause of a slowdown
Post by: maru on 2023-05-04, 17:29:27
You can also try this as a troubleshooting step: https://support.chaos.com/hc/en-us/articles/13940160485009
Title: Re: Tracking down the cause of a slowdown
Post by: romullus on 2023-05-04, 23:30:55
One thing i have noticed though is that even when i hide the imported objects, the slow rendertime stays there.
If i dont import it, the scene renders fine.

What if you delete those objects instead of hiding them, does it affect render time in any way?
Title: Re: Tracking down the cause of a slowdown
Post by: Jpjapers on 2023-05-05, 00:07:36
One thing i have noticed though is that even when i hide the imported objects, the slow rendertime stays there.
If i dont import it, the scene renders fine.

What if you delete those objects instead of hiding them, does it affect render time in any way?

As i track down the cause, i will test this out.
The railclone tip above helped with the parsing but my UHD Cache is still multiple minutes long so ive got some digging to do.
Title: Re: Tracking down the cause of a slowdown
Post by: Avi on 2023-05-05, 07:08:25
Just a tip:

If you can use one of the Sini tools called Sini Forensic, it can help you scan your scene and provide you with an overview of problematic issues present in your scene.

https://sinisoftware.com/Plugins/Forensic
Title: Re: Tracking down the cause of a slowdown
Post by: Aram Avetisyan on 2023-05-05, 10:39:17
A known thing for slowdowns are some of the effects (e.g. Fire effect) in Environment and Effect menu.
Have a quick look and see if there are any "unexpected" effects, and delete them.
Title: Re: Tracking down the cause of a slowdown
Post by: romullus on 2023-05-05, 11:01:46
A known thing for slowdowns are some of the effects (e.g. Fire effect) in Environment and Effect menu.
Have a quick look and see if there are any "unexpected" effects, and delete them.

An idea - could Corona check for the presence of such effects and give a warning to the user, like it does for bitmap paging, FTH and other potential causes of slowdown?
Title: Re: Tracking down the cause of a slowdown
Post by: Jpjapers on 2023-05-05, 11:06:03
Just a tip:

If you can use one of the Sini tools called Sini Forensic, it can help you scan your scene and provide you with an overview of problematic issues present in your scene.

https://sinisoftware.com/Plugins/Forensic

Yeah thats my first step every time and the file isnt showing anything problematic.

Is there any way to set up any of the corona passes to highlight complex materials?
Would be super useful to be able to do like a false-colour pass to identify shaders causing slowdowns.
Title: Re: Tracking down the cause of a slowdown
Post by: maru on 2023-05-11, 14:34:24
Is there any way to set up any of the corona passes to highlight complex materials?
Would be super useful to be able to do like a false-colour pass to identify shaders causing slowdowns.

There is!

You can use the CInfo_TimePerSample element for this - https://docs.chaos.com/display/CRMAX/Render+Elements#RenderElements-CInfo

Title: Re: Tracking down the cause of a slowdown
Post by: Jpjapers on 2023-05-15, 22:15:32
Is there any way to set up any of the corona passes to highlight complex materials?
Would be super useful to be able to do like a false-colour pass to identify shaders causing slowdowns.

There is!

You can use the CInfo_TimePerSample element for this - https://docs.chaos.com/display/CRMAX/Render+Elements#RenderElements-CInfo

Ah fantastic, for some reason i assumed that was a render stamp type pass.