Nuke binary plugins  14.0.8
slr::SlrThreadContext Class Reference

Public Member Functions

void setThreadID (uint32_t index, uint32_t nThreads, DD::Image::ThreadId Id)
 Assign the thread info.
 
uint32_t index () const
 
uint32_t nThreads () const
 
DD::Image::ThreadId threadId () const
 
const std::vector< SlrShadingContext > & shaderContextList () const
 Returns a reference to the shader context list.
 
void setInterestRatchet (DD::Image::InterestRatchet *interest)
 
void clearShaderContexts ()
 Clear the shader context list but keep the memory allocation.
 
SlrShadingContextcurrentShaderContext ()
 Get the current SlrShaderContext (the last in the list.)
 
SlrShadingContextgetShaderContext (uint32_t i)
 Get the shader context for index i.
 
SlrShadingContextpushShaderContext (const SlrShadingContext *src_stx=nullptr)
 Add a SlrShaderContext to the end of the list, and return it, copying 'stx' if it's not null. More...
 
SlrShadingContextpushShaderContext (const SlrShadingContext &src_stx, const fdk::Vec3f &Rdir, double minT, double maxT, uint32_t ray_type, uint32_t sides_mode, const RayDifferentials *Rdif=nullptr)
 Add a SlrShaderContext to the end of the list, copying the source context, returning a reference to it.
 
SlrShadingContextpushShaderContext (const SlrShadingContext &src_stx, const RayContext &Rtx, uint32_t ray_type, uint32_t sides_mode, const RayDifferentials *Rdif=nullptr)
 Add a SlrShaderContext to the end of the list, copying the source context, returning a reference to it.
 
int popShaderContext ()
 Remove a SlrShaderContext from the end of the list, and return the new index or -1 if empty.
 

Public Attributes

DD::Image::Pixel texture_color
 For sampling texture map Iops - defaults to RGBA.
 
DD::Image::Pixel binding_color
 For Connection sampling calls - defaults to RGBA.
 
DD::Image::Pixel illum_color
 For LightShader evaluation - defaults to RGB.
 
DD::Image::Pixel shadow_color
 For LightShader shadow transmission evaluation - defaults to RGB (no depth!)
 
DD::Image::Pixel volume_color
 For VolumeShader color evaluation - defaults to RGB.
 

Detailed Description

The render context (SlrRenderContext) has one of these for each thread it's performing shading calls with.

It stores thread-safe variables to help avoid per-sample allocation/deletion costs for temporary structures like a Pixel in a SlrShader.

Since there's usually very few of these (one per thread) the vars can be generous with their memory reserves. ie even at 90 threads (which may kill Nuke performance in other ways,) 90 of these objects would only occupy a relatively small amount of temporary memory.

Member Function Documentation

void slr::SlrThreadContext::setInterestRatchet ( DD::Image::InterestRatchet interest)

Assigns an InterestRatchet to all the Pixels. This InterestRatchet var is usually a local var sitting in the renderer's engine() method, which is thread safe.

References binding_color, illum_color, shadow_color, texture_color, and volume_color.

SlrShadingContext & slr::SlrThreadContext::pushShaderContext ( const SlrShadingContext src_stx = nullptr)

Add a SlrShaderContext to the end of the list, and return it, copying 'stx' if it's not null.

Add a SlrShadingContext to the end of the list, and return its reference.

References slr::SlrShadingContext::atmosphere_shader, slr::SlrShadingContext::displacement_shader, slr::SlrShadingContext::previous_stx, slr::SlrShadingContext::rtriangle, slr::SlrShadingContext::slrtx, slr::SlrShadingContext::sttx, and slr::SlrShadingContext::surface_shader.

Referenced by pushShaderContext().



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