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

#include <SlrLightShader.h>

Public Member Functions

 ~SlrLightMaterial ()
 Releases the SlrShader allocations in the SlrLightShaderGroup.
 
int32_t renderVersion () const
 Current render version the material has been updated at.
 
void setRenderVersion (int32_t v)
 
SlrLightShader * light () const
 
SlrCoShader * projection () const
 Color/texture used by light.
 
void validateLight (SlrRenderContext &slrtx)
 
void requestResources (const DD::Image::ChannelSet &request_channels, SlrRenderContext &slrtx)
 Calls requestResources() 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 fdk::Vec3f &lobeN, const SlrLightInfo &ltInfo, ndk::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 SlrLightMaterialtranslateUsgMaterial (SlrRenderContext &slrtx, const usg::Prim &prim, const fdk::TimeValue &time, const usg::Path &material_path, SlrLightMaterial *existing_slr_material)
 

Public Attributes

SlrLightShader * lightShader
 Shader for light itself.
 
SlrCoShaderGroup projectionGroup
 Shader group for image projection - managed externally.
 
DD::Image::Hash hash
 Global hash of object material.
 
DD::Image::ChannelSet textureChannels
 All the channels from all texture samplers.
 
DD::Image::Channel shadowChannel
 Channels to write shadow weight to.
 
DD::Image::ChannelSet outputChannels
 All the channels this material outputs.
 
SlrShader::InputBindingList textureBindings
 List of all texture bindings used in material.
 

Protected Attributes

int32_t _renderVersion
 Updated each time material is refreshed.
 

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, 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

◆ translateUsgMaterial()

SlrLightMaterial * slr::SlrLightMaterial::translateUsgMaterial ( SlrRenderContext &  slrtx,
const usg::Prim &  prim,
const fdk::TimeValue &  time,
const usg::Path &  material_path,
SlrLightMaterial existing_slr_material 
)
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.

References slr::SlrShaderGroup< ShaderT >::deleteShaders(), lightShader, slr::SlrShaderGroup< ShaderT >::output, projectionGroup, and slr::SlrShaderGroup< ShaderT >::shaders.

◆ validateLight()

void slr::SlrLightMaterial::validateLight ( SlrRenderContext &  slrtx)

Validates the output light shader, sets the output material channels, and determines enabled state of the light.



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