Nuke binary plugins  14.0.8
slr::SlrLightMaterial Class Reference

Public Member Functions

 SlrLightMaterial (SlrRenderContext *slrtx)
 
 ~SlrLightMaterial ()
 Releases the SlrShader allocations in the SlrLightShaderGroup.
 
SlrLightShader * light () const
 
void validateShader (const SlrRenderContext &slrtx)
 Calls the output shader, if assigned, and sets the material channels.
 
void requestTextures (const DD::Image::ChannelSet &request_channels, SlrRenderContext &slrtx)
 Calls requestTextures() on the set of input shaders.
 
void initializeForShading (uint32_t num_shading_threads, SlrRenderContext &slrtx)
 Calls initializeForShading() on the set of input shaders.
 
bool illuminate (const SlrShadingContext &stx, const SlrLightInfo &ltInfo, RayContext &illumRayOut, float &directPdfWeightOut, DD::Image::Pixel &colorOut, DD::Image::Pixel &shadowTransmissionOut) const
 Redirects to light_group.output, if valid.
 

Static Public Member Functions

static void translateLightPrim (const usg::StageConstRef &stage, const fdk::TimeValue &time, const usg::LightPrim &ltPrim, SlrLightInfo &ltInfo, SlrRenderContext &slrtx)
 

Public Attributes

SlrLightShaderGroup light_group
 Slr(ScanlineRender) Shader group - managed externally.
 
DD::Image::Hash hash
 Global hash of object material.
 
DD::Image::ChannelSet texture_channels
 All the channels from all texture samplers.
 
DD::Image::Channel shadow_channel
 Channels to write shadow weight to.
 
DD::Image::ChannelSet output_channels
 All the channels this material outputs.
 
SlrShader::InputBindingList texture_bindings
 List of all texture bindings used in material.
 

Protected Attributes

SlrRenderContext * _slrtx
 Used to build OutputContext for shaders, if needed.
 

Detailed Description

Entry point for SlrLightShader groups.

There's one of these created for each enabled SlrLightInfo in the primary render scene.

They're stored in the SlrRenderContext active_light_materials list, owned by the renderer, and are are static for the entire render session so any texture bindings remain stable and thread safe through the entirety of the render.

Member Function Documentation

void slr::SlrLightMaterial::translateLightPrim ( const usg::StageConstRef &  stage,
const fdk::TimeValue &  time,
const usg::LightPrim &  ltPrim,
SlrLightInfo ltInfo,
SlrRenderContext &  slrtx 
)
static

Fills in/updates the SlrRenderContext with the SlrShaders created from the enabled SlrLightInfos.

The lightinfo will be updated to point at any created or existing material. This is usually called by the renderer in its _validate() method as all the shaders are required to know what input textures and channels the renderer needs to output and request.

The SlrRenderContext holds the shared resources that are pointed to by the SlrLightInfos stored in each SlrScene time sample.

References slr::SlrShaderGroup< ShaderT >::deleteShaders(), light_group, slr::SlrLightInfo::light_index, slr::SlrLightInfo::material, slr::SlrShaderGroup< ShaderT >::output, slr::SlrShaderGroup< ShaderT >::property_hash, slr::SlrShaderGroup< ShaderT >::shaders, and slr::SlrShaderGroup< ShaderT >::topology_hash.



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