#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 * | imagingShader () const |
| Color/texture used by light. | |
| void | updateLightPropertiesAt (const SlrEngineContext &slrtx, const usg::Prim &lightPrim, const fdk::TimeValue &time) |
| const ShadingLayerReqSet & | writableShadingLayers () const |
| Lights that need to sample input textures declare their shading layers via this. | |
| void | validateLight (SlrEngineContext &slrtx) |
| void | requestResources (const DD::Image::ChannelSet &request_channels) |
| Calls requestResources() on the set of input shaders. | |
| void | initializeForShadingThread (SlrThreadContext &sttx) |
| Calls initializeForShadingThread() on the set of input shaders. | |
| void | cleanupAfterShading () |
| Calls cleanupAfterShading() on the set of input shaders. | |
Static Public Member Functions | |
| static SlrLightMaterial * | translateUsgMaterial (SlrEngineContext &slrtx, const usg::Prim &lightPrim, const fdk::TimeValue &time, const usg::Path &materialPath, SlrLightMaterial *existingSlrMaterial) |
Public Attributes | |
| SlrLightShader * | lightShader |
| Shader for light itself. | |
| SlrCoShaderGroup | imagingGroup |
| Shader group for light image source - managed externally. | |
| DD::Image::Hash | hash |
| Global hash of object material. | |
| DD::Image::ChannelSet | inputTextureChannels |
| All the channels from all input texture samplers. | |
| DD::Image::ChannelSet | outputColorChannels |
| All the color (blendable) channels this material outputs. | |
| DD::Image::ChannelSet | outputDataChannels |
| All the data (non-blendable) channels this material outputs. | |
| bool | castsShadows |
| True if light casts shadows. | |
| std::unique_ptr< usg::PathExpression > | objectIllumMask |
| Path Expression for object illumination matching if present. | |
| std::unique_ptr< usg::PathExpression > | objectReceiveShadowMask |
| Path Expression for recieving shadowing matching if present. | |
| SlrShader::InputBindingList | textureBindings |
| List of all texture bindings used in material. | |
Protected Attributes | |
| int32_t | _renderVersion |
| Updated each time material is refreshed. | |
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 SlrEngineContext, owned by the renderer, and are static for the entire render session so any texture bindings remain stable and thread safe through the entirety of the render.
|
static |
Fills in/updates the SlrEngineContext 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 SlrEngineContext holds the shared resources that are pointed to by the SlrLightInfos.
References slr::SlrShaderGroup< ShaderT >::deleteShaders(), imagingGroup, lightShader, slr::SlrShaderGroup< ShaderT >::output, slr::SlrShaderGroup< ShaderT >::shaders, and updateLightPropertiesAt().
| void slr::SlrLightMaterial::updateLightPropertiesAt | ( | const SlrEngineContext & | slrtx, |
| const usg::Prim & | lightPrim, | ||
| const fdk::TimeValue & | time | ||
| ) |
Called either on shader creation or shader value update. Updates core light parameters on the material and shaders.
Referenced by translateUsgMaterial().
| void slr::SlrLightMaterial::validateLight | ( | SlrEngineContext & | slrtx | ) |
Validates the output light shader, sets the output material channels, and determines enabled state of the light.
| ©2026 The Foundry Visionmongers, Ltd. All Rights Reserved. |