#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 |
| SlrShadingContext * | srcStx () 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. | |
| StxLayeringStack & | hitPointStack () 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 |
| StxLayeringStack & | layeringStack () 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.) | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const SlrRayContext &) |
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.
| bool slr::SlrRayContext::isValid | ( | ) | const |
Returns true if this ray is attached to a render thread context. InvalidRay() will return false.
| 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().
| 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().
| 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().
| 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.
| 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().
| 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.
| 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. |