question

Alan Jones avatar image
Alan Jones asked ·

Per Bucket Data

Hi,

I'd like to be able to create some data for each bucket that renders and to clean it up when it's done. I'd prefer it to be at that level of granularity rather than per thread (though if there's an option for that, it'd be better than nothing) as I know it won't be needed within other buckets and each bucket is single threaded with a shorter lifetime. (Though, of course, just clearing and reusing would be even nicer if it's made per thread, but reset at the start of each bucket).

It's in a camera shader, if that's relevant. Are there APIs around that would facilitate this? I've not managed to find anything obvious. Couldn't find documentation on how calls to node_initialize etc relate to threads. Do any of those happen to be done per thread?

As a worst case, even been able to get the number of threads and bucket size would be enough for me to use. Perhaps just number of threads would be enough, but for that I would need to know if pixels are completed one at a time (i.e. whether all samples within a given pixel are made sequentially or if all samples within a bucket are randomly processed within a thread)

EDIT: Now, I've gotten to the point where querying bucket size would be enough for me to get what I want. So, turns out it's in options, but only when it's non-default of 64. So I can access that, combined with using thread_local, I can get something that'll do the trick for me here.

EDIT2: Hmmm, okay, I've noticed that a single thread can have more than one bucket going at once. Is that hard coded? (if so how many) Or is it variable, if so, how can I access it?

EDIT3: the best thing for my particular case would be if I can get an index per sample within a pixel. Is that available anywhere? That's all I'm trying to generate with all this.

Cheers,

Alan.

arnold
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

An answer to the original question, before the three edits:


You could write a dummy driver. You'll get callbacks for each bucket at different stages, and from 6.1 you can connect the driver to the next one using something like this

custom_driver
{
 name my_custom_driver
}
driver_exr # or any other
{
 input my_custom_driver
 ...
}
3 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Thanks, Stephen. This would need to be added in manually to each render pass, correct? There's no mtoa callbacks or (even better, at Arnold level) for it to register itself for all of them?

0 Likes 0 · ·

It would have to be manual.

This is actually how the new imager nodes are hooked up. The user adds imagers, and we set the input parameters to chain them together.

1 Like 1 · ·
Alan Jones avatar image Alan Jones Stephen Blair ♦♦ ·

Thanks :) most appreciated.

0 Likes 0 · ·
Max Tarpini avatar image
Max Tarpini answered ·

Guess what ? That's called 'subpixel sample index' in AtShaderGlobals :)

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Thanks, Max. I don't have AtShaderGlobals because this is in a camera node and create_camera_ray has no shader globals. Is there a way to access a shader globals in a camera shader I've missed somewhere? That would be awesome news.

0 Likes 0 · ·
Alan Jones avatar image
Alan Jones answered ·

Not sure if notifications for replies to comments go out, so just writing here, hoping it'll trigger notifications.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.