Nuke binary plugins 15.1.5
 
Loading...
Searching...
No Matches
slr::SlrIntegratorContext Class Reference

#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::FormatrenderFormat () const
 
const DD::Image::BoxrenderRegion () 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::PixelbgPixel () const
 
DD::Image::PixeloutputPixel ()
 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
 

Detailed Description

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.

Member Function Documentation

◆ subpixelXY()

const fdk::Vec2f & slr::SlrIntegratorContext::subpixelXY ( size_t  i) const
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.

◆ bgPixel()

const DD::Image::Pixel & slr::SlrIntegratorContext::bgPixel ( ) const
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.

◆ getNearestIntersections() [1/2]

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.

◆ getNearestIntersections() [2/2]

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.

◆ getAllIntersections() [1/2]

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.

◆ getAllIntersections() [2/2]

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.

◆ startNewRtxBundle()

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.

◆ currentRtxBundle()

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.

◆ startNewStxBundle()

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.

◆ currentStxBundle()

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.
www.foundry.com