Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Per Bucket Data

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
alan-LFL
268 Views, 7 Replies

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.

Tags (1)
Labels (1)
7 REPLIES 7
Message 2 of 8
maxtarpini
in reply to: alan-LFL

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

Message 3 of 8
Stephen.Blair
in reply to: alan-LFL

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
 ...
}


// Stephen Blair
// Arnold Renderer Support
Message 4 of 8
alan-LFL
in reply to: maxtarpini

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.

Message 5 of 8
alan-LFL
in reply to: Stephen.Blair

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?

Message 6 of 8
alan-LFL
in reply to: alan-LFL

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

Message 7 of 8
Stephen.Blair
in reply to: alan-LFL

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.



// Stephen Blair
// Arnold Renderer Support
Message 8 of 8
alan-LFL
in reply to: Stephen.Blair

Thanks 🙂 most appreciated.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report