#include <SlrIntegrator.h>
Public Member Functions | |
const fdk::Vec2i & | pixelXY () const |
int32_t | pixelX () const |
int32_t | pixelY () const |
bool | isPixel (int32_t x, int32_t y) const |
bool | isPixelX (int32_t x) const |
bool | isPixelY (int32_t y) const |
bool | isDebugPixel () const |
bool | isDebugSample () const |
const DD::Image::Format & | renderFormat () const |
const DD::Image::Box & | renderRegion () const |
int32_t | nSamples () const |
Number of primary/camera ray samples. | |
ndk::SamplingRngSet & | samplingRng () const |
Sampling random number generator owned by this thread. | |
const fdk::Vec2fList & | subpixelXYs () const |
const fdk::Vec2f & | subpixelXY (size_t i) const |
const int32_t | primaryRayBundle () const |
const int32_t | nPrimaryRays () const |
const fdk::TimeValueList & | times () const |
fdk::TimeValue | time (size_t i) const |
const DD::Image::Pixel & | bgPixel () const |
DD::Image::Pixel & | outputPixel () |
Final integrated & flattened result. | |
void | getNearestIntersections (const SlrShadingContext &srcStx, const ndk::RayContext *rtxArray, int32_t nRays, StxBundle &stxBundle) const |
void | getNearestIntersections (const SlrShadingContext &srcStx, const ndk::RayContext *rtxArray, int32_t nRays, ndk::RayHitPointfList &hitList) const |
void | getAllIntersections (const SlrShadingContext &srcStx, const ndk::RayContext &Rtx, StxBundle &stxBundle) const |
void | getAllIntersections (const SlrShadingContext &srcStx, const ndk::RayContext &Rtx, ndk::RayHitPointfList &hitList) const |
bool | getUVIntersection (const SlrShadingContext &srcStx, const fdk::Vec2f &Puv, SlrShadingContext &hitStx) const |
Intersect a 2d UV point with surface UV coords, returning true if hitStx is filled in. | |
ndk::RayContextBundle & | startNewRtxBundle () const |
ndk::RayContextBundle & | currentRtxBundle () const |
StxBundle & | startNewStxBundle () const |
StxBundle & | currentStxBundle () const |
const StxBundleList & | stxBundles () const |
List of currently-created SlrShadingContext bundles. | |
StxBundleList & | activeStxBundles () const |
Protected Member Functions | |
SlrIntegratorContext (SlrThreadContext *) | |
Protected Attributes | |
SlrThreadContext * | _sttx |
fdk::Vec2i | _pixelXY |
Output pixel screen coords. | |
int32_t | _primaryRayBundle |
All the camera rays for this output pixel. | |
int32_t | _nPrimaryRays |
Number of primary rays in bundle. | |
fdk::Vec2fList | _subpixelXYs |
All the subpixel uv coords for this output pixel, one per primary ray. | |
fdk::TimeValueList | _times |
All the sample times, one per primary ray. | |
DD::Image::Pixel | _bgPixel |
Background pixel data. | |
DD::Image::Pixel | _outputPixel |
The output pixel data, flattened. | |
Friends | |
class | SlrThreadContext |
class | RenderEngine |
class | IntersectedSurfaces |
This class is passed to an SlrIntegrator from the renderer pixel loop for each pixel being rendered. It contains all the camera rays being shot for a pixel so the integrator could perform spatial weighting since each ray origin is at a known relative subpixel location inside the pixel.
|
inline |
Returns the subpixel XY offset coordinate inside pixelXY where 0,0 is the center of the pixel, -1,-1 is the pixel left/bottom edge, and +1,+1 is the pixel right/top edge.
|
inline |
Background for final integrated result. The output pixel of the integrator is expected to incorporate the background into its final result. This is provided as a separate value as an integrator may need this value first in the integration vs. compositing the integrated result at the end.
void slr::SlrIntegratorContext::getNearestIntersections | ( | const SlrShadingContext & | srcStx, |
const ndk::RayContext * | rtxArray, | ||
int32_t | nRays, | ||
StxBundle & | stxBundle | ||
) | const |
Intersect a bundle of rays with the closest surfaces to the ray origins, filling in shading contexts. There will only be one shading context created per ray, so the size of the StxBundle will never exceed nRays. If the rays are a coherent set the hits can be described as a 'wavefront' pushed out from the ray origins along the ray directions.
Building surface shading contexts requires evaluating additional surface properties so is more costly than getting the raw geometric hit info.
Note that stxBundle is -not- cleared before adding hits to it.
void slr::SlrIntegratorContext::getNearestIntersections | ( | const SlrShadingContext & | srcStx, |
const ndk::RayContext * | rtxArray, | ||
int32_t | nRays, | ||
ndk::RayHitPointfList & | hitList | ||
) | const |
Intersect a bundle of rays with the closest surfaces to the ray origins, filling in geometric hit infos. There will only be one hit info created per ray, so the size of the hit list will never exceed nRays. If the rays are a coherent set the hits can be described as a 'wavefront' pushed out from the ray origins along the ray directions.
Note - hitList -is- cleared before adding the hits.
void slr::SlrIntegratorContext::getAllIntersections | ( | const SlrShadingContext & | srcStx, |
const ndk::RayContext & | Rtx, | ||
StxBundle & | stxBundle | ||
) | const |
Intersect a single ray with all surfaces, filling in shading contexts. In this case the output StxBundle contains the list of intersections along a single ray path rather than a list from multiple ray paths.
This is the most expensive intersection method as all intersectable surfaces are retrieved, even potentially hidden ones, and building surface shading contexts requires evaluating additional surface properties.
Note that stxBundle is -not- cleared before adding hits to it.
void slr::SlrIntegratorContext::getAllIntersections | ( | const SlrShadingContext & | srcStx, |
const ndk::RayContext & | Rtx, | ||
ndk::RayHitPointfList & | hitList | ||
) | const |
Intersect a single ray with the all surfaces, filling in geometric hit infos. Note - hitList is -not- cleared before adding the hits.
ndk::RayContextBundle & slr::SlrIntegratorContext::startNewRtxBundle | ( | ) | const |
Start a new RayContext bundle making it the current bundle and returning a reference to it. Note that only one bundle may be active at a time since each bundle must be a contiguous section of RayContexts in the cache.
ndk::RayContextBundle & slr::SlrIntegratorContext::currentRtxBundle | ( | ) | const |
Access the current RayContextBundle for this thread which can then be added to. Note that only one bundle may be current at a time.
StxBundle & slr::SlrIntegratorContext::startNewStxBundle | ( | ) | const |
Start a new StxBundle making it the current bundle and returning a reference to it. Note that only one bundle may be active at a time since each bundle must be a contiguous section of SlrShadingContexts in the cache.
StxBundle & slr::SlrIntegratorContext::currentStxBundle | ( | ) | const |
Access the current StxBundle for this thread which can then be added to. Note that only one bundle may be current at a time.
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |