Nuke binary plugins 16.1.1
 
Loading...
Searching...
No Matches
slr::SlrRayContext Struct Reference

#include <SlrRayContext.h>

Inherits ndk::RayContext.

Public Member Functions

bool isValid () const
 
ndk::RayContext & asRayContext ()
 Access the writable RayContext portion of this.
 
const ndk::RayContext & asRayContext () const
 
SlrShadingContextsrcStx () const
 Source surface if this ray was spawned from one, or null if not.
 
int32_t nHitPoints () const
 
void sortHits (bool nearToFar=true) const
 Sort the hits in desired direction. Ray hit index 0 is either nearest or farthest after sorting.
 
void sortHitsNearToFar () const
 Ray hit index 0 is nearest after sorting.
 
void sortHitsFarToNear () const
 Ray hit index 0 is farthest after sorting.
 
StxLayeringStackhitPointStack () const
 
const ndk::RayHitPointf & getHitPoint (int32_t rayHitIndex=0) const
 
const ndk::RayHitPointf & moveHitPointTo (int32_t rayHitIndex, StxBundle &toBundle) const
 
const ndk::RayHitPointf & moveHitPointToLayeringStack (int32_t rayHitIndex) const
 Same, but to the layering stack bundle.
 
ndk::OpacityTraitsMask hitPointsOpacityOrMask () const
 OpacityTraitsMask of all the hit points OR'd together.
 
ndk::OpacityTraitsMask hitPointsOpacityAndMask () const
 OpacityTraitsMask of all the hit points AND'd together.
 
bool areAllHitsOpaqueSolid () const
 
bool doAllHitsBlend () const
 
bool doAllHitsBlendToOpaque () const
 
StxLayeringStacklayeringStack () const
 Retrieve the list of shading contexts.
 
void clearLayeringStack () const
 Empty the layering stack.
 
 SlrRayContext (int16_t i)
 For internal use only (for constructing error rays.)
 

Protected Member Functions

 SlrRayContext ()=default
 Member vars left intentionally uninitialized for performance reasons.
 
 SlrRayContext (const ndk::RayContext &rtx)
 
 SlrRayContext (const fdk::Vec3f &_origin, const fdk::Vec3f &_dir, TypeMask _type, fdk::TimeValue _time, int16_t _id, float _minDist, float _maxDist)
 

Friends

std::ostream & operator<< (std::ostream &o, const SlrRayContext &)
 

Detailed Description

Specialization of ndk::RayContext for Slr2 use, with a reference to the thread context data.

While the ray geometry is free to be manipulated the intersection data generated by this ray is stored in thread-safe memory managed by the renderer.

Specialization of SlrRayContext for single ray trace (ad-hoc rays) which are not persistent. Wraps a single SlrRayContext which is released on destruction.

Member Function Documentation

◆ isValid()

bool slr::SlrRayContext::isValid ( ) const

Returns true if this ray is attached to a render thread context. InvalidRay() will return false.

◆ nHitPoints()

int32_t slr::SlrRayContext::nHitPoints ( ) const

Retrieve the hit point count from the last ray cast, and is only valid until the next ray cast call this ray is passed to.

Referenced by slr::SlrIntegratorContext::getThinTransmissionFactor().

◆ hitPointStack()

StxLayeringStack & slr::SlrRayContext::hitPointStack ( ) const

Retrieve the list of hits filled in during the last ray cast call this ray context was passed to. The list of hits are always along the ray's direction vector which is why this list is termed a 'stack'.

Note that this list is volatile and will be overwritten during the next ray cast call this ray is passed to, so move any hit points you care about out of the list before passing this ray to another intersection method.

Referenced by slr::SlrIntegratorContext::getAllIntersections(), slr::SlrIntegratorContext::getBboxIntersection(), and slr::SlrIntegratorContext::trace().

◆ getHitPoint()

const ndk::RayHitPointf & slr::SlrRayContext::getHitPoint ( int32_t  rayHitIndex = 0) const

Retrieve a hit point from the last ray cast from 0..nRayHitPoints(). No range checking or null testing is done - the index is assumed to be within nRayHitPoints().

◆ moveHitPointTo()

const ndk::RayHitPointf & slr::SlrRayContext::moveHitPointTo ( int32_t  rayHitIndex,
StxBundle toBundle 
) const

Move/extract the hit point reference out of this ray's hit stack, transferring ownership of it to toBundle and setting the old reference to null. Note this does -NOT- change the size of the hit point list, for performance reasons. Returns a reference to the hit point in the new location.

◆ areAllHitsOpaqueSolid()

bool slr::SlrRayContext::areAllHitsOpaqueSolid ( ) const

All hits are opaque-solid, that is we cannot see through the first surface and if desired can skip all the other hits.

Referenced by slr::SlrIntegratorContext::getThinTransmissionFactor().

◆ doAllHitsBlend()

bool slr::SlrRayContext::doAllHitsBlend ( ) const

If false then only the first hit matters since we should never see through it. If true then all the hits need to be blended, and if doAllHitsBlendToOpaque() is also true then blending can be done front-to-back.

◆ doAllHitsBlendToOpaque()

bool slr::SlrRayContext::doAllHitsBlendToOpaque ( ) const

If true all the hits do 'standard' blending that can result in 1.0 opacity. If false then at least one of the hits needs to do 'non-standard' blending (like min, max, plus) and blending should be done back-to-front.



©2026 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com