- 1 Introduction
- 1.1 Bucket Object
- 1.1.1 (1) SDK: RenderBucket::Thread
- 1.1.2 (2) SDK: RenderBucket::SampleVec
- 1.1.3 (3) SDK: RenderBucket::PushRay
- 1.1.4 (4) SDK: RenderBucket::PopRay
- 1.1.5 (5) SDK: RenderBucket::GetGIBounce
- 1.1.6 (6) SDK: RenderBucket::GetPixel
- 1.1.7 (7) SDK: RenderBucket::GetSubPixel
- 1.1.8 (8) SDK: RenderBucket::GetTimeOffset
- 1.1.9 (9) SDK: LXu_RENDERBUCKET, etc. defines
- 1.1.10 (10) SDK: RenderBucket object from the sample vector
- 1.1 Bucket Object
This module implements the bucket interface that can be used during rendering with sample vectors.
The bucket is exposed to clients via the render bucket interface, which is actually a packet in the sample vector.
The simplest thing the RenderBucket interface can be used for is to get the thread number of the current rendering thread. This will be a value from 0 through n-1, where n is the number of rendering threads.
(1) SDK: RenderBucket::Thread
We can also get the sample vector back from the bucket object.
(2) SDK: RenderBucket::SampleVec
We can push and pop rays onto the ray stack. These functions are equivalent to those in the Raycast interface.
(3) SDK: RenderBucket::PushRay
(4) SDK: RenderBucket::PopRay
GetGIBounce will directly return the number of global illumination bounces prior to the current shading evaluation. This will allow a shader to compare it against the maximum global illumination bounces, and exit if it's already reached the maximum.
(5) SDK: RenderBucket::GetGIBounce
GetPixel will indirectly (through the x and y argument pointers) return the current pixel being evaluated by this thread.
(6) SDK: RenderBucket::GetPixel
GetSubPixel will get the position of the current sample being evaluated within the pixel. It indirectly returns the values via the pointers to x and y. The values returned are between 0.0 and 1.0.
(7) SDK: RenderBucket::GetSubPixel
GetTimeOffset will return a value between 0.0 and 1.0 indicating the time within an exposure being currently evaluated (to allow motion / temporal blur in shading, for instance).
(8) SDK: RenderBucket::GetTimeOffset
(9) SDK: LXu_RENDERBUCKET, etc. defines
Here is an example of how to get the render bucket object from the sample vector. Note that the offset should really be computed outside of the Evaluate function as it is a lookup that is too slow in the context of shader evaluation.