Anim8or Community

General Category => General Anim8or Forum => Topic started by: thecolclough on September 30, 2021, 10:46:27 am

Title: ART thread optimisation
Post by: thecolclough on September 30, 2021, 10:46:27 am
another question for Steve...

the project mentioned in my previous thread includes some light bulbs in the scene, and i can see that the pixels occupied by the glass material take several times longer to render in ART compared to those occupied by simpler materials - which is to be expected.

as a side effect, this means that my 12-thread processor can blast through most of the render in a matter of seconds, but then a small number of threads (typically 2 to 6) get stuck working on the glass pixels for a few minutes while the rest of the CPU goes idle.  not much of an issue when rendering a single frame, but i need to output more than 5,000 of the darn things, so that'll be a lot of wasted core time :P

so here's what i was wondering: ART currently seems to divide up the image into blocks of 100x100 pixels (or thereabouts), and i was wondering if we could achieve more efficient CPU utilisation for bulk renders if that figure was changed to, say, 10x10 pixels per block?  or maybe make it user-configurable?
Title: Re: ART thread optimisation
Post by: Steve on October 01, 2021, 08:00:17 am
You can change the size of the rendering chunks. Make an int attribute (menu command Scene->Attributes dialog) named ChunkSize and set it the the size that you want. Note that there are extra computations for the pixels around each chunk so if you make it too small it could slow the render down.

You can also experiment with the attribute RayDepth to limit extremely deep rays tha can occur with some geometry.
Title: Re: ART thread optimisation
Post by: Steve on October 01, 2021, 08:04:08 am
Also see this topic https://www.anim8or.com/smf/index.php/topic,5732.msg43068.html#msg43068 (https://www.anim8or.com/smf/index.php/topic,5732.msg43068.html#msg43068) for more information.
Title: Re: ART thread optimisation
Post by: thecolclough on October 04, 2021, 12:27:18 pm
ah, good to know.  i must have either missed that discussion when it first happened, or managed to forget about it =P

thanks Steve
Title: Re: ART thread optimisation
Post by: ENSONIQ5 on October 05, 2021, 02:44:09 am
Note that there are extra computations for the pixels around each chunk so if you make it too small it could slow the render down.

I frequently reduce chunk sizes in other renderers for the exact reason thecolclough stated, to ensure there's more than one or two threads left battling their way through a complicated bit of the scene at the end of a frame, and I've often wondered what disadvantages there were (if any) to small chunk sizes.  So this is good to know :)