Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
slr::SlrSurfaceMaterial Class Reference

#include <SlrSurfaceShader.h>

Public Member Functions

 ~SlrSurfaceMaterial ()
 Releases the SlrShader allocations in the SlrSurfaceShaderGroup.
 
int32_t renderVersion () const
 Current render version the material has been updated at.
 
void setRenderVersion (int32_t v)
 
const std::string & path () const
 Return the path of the surface_group output shader, if there is one.
 
SlrSurfaceShader * surface () const
 
SlrGeometryShader * displacement () const
 
void validateShader ()
 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.
 
float surfaceShader (const SlrShadingContext &stx, DD::Image::Pixel &out)
 Redirects to surface_group.output, if valid.
 
void displacementShader (const SlrShadingContext &stx, SlrShadingParams &out)
 Redirects to surface_group.output, if valid.
 
float displacementBound ()
 

Static Public Member Functions

static SlrSurfaceMaterialtranslateUsgMaterial (SlrRenderContext &slrtx, const fdk::TimeValue &time, const usg::Path &material_path, SlrSurfaceMaterial *existing_slr_material)
 

Public Attributes

SlrSurfaceShaderGroup surfaceGroup
 Slr(ScanlineRender) Shader group - managed externally.
 
SlrGeometryShaderGroup displacementGroup
 Slr(ScanlineRender) Shader group - managed externally.
 
DD::Image::Hash hash
 Global hash of object material.
 
DD::Image::ChannelSet textureChannels
 All the channels from all texture samplers.
 
DD::Image::ChannelSet outputChannels
 All the channels this material outputs.
 
DD::Image::Format outputFormat
 Nominal Format if the material represents a texture.
 
SlrShader::InputBindingList textureBindings
 List of all texture bindings used in material.
 
bool displacementEnabled
 Is displacement enabled?
 
int displacementSubdivisionLevel
 What recursion level to subdivide to.
 
fdk::Vec3f displacementBounds
 Displacement bounds scaled by local-to-world matrix.
 

Protected Attributes

int32_t _renderVersion
 Updated each time material is refreshed.
 

Detailed Description

Entry point for SlrSurfaceShader and SlrGeometryShader groups.

There's one of these created for each enabled SlrPrimInfo 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()

SlrSurfaceMaterial * slr::SlrSurfaceMaterial::translateUsgMaterial ( SlrRenderContext &  slrtx,
const fdk::TimeValue &  time,
const usg::Path &  material_path,
SlrSurfaceMaterial existing_slr_material 
)
static

Fills in/updates the SlrSurfaceMaterial with the SlrShaders created from the enabled SlrPrimInfo and its assigned material prim path.

The priminfo 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 SlrPrimInfos.

References slr::SlrShaderGroup< ShaderT >::deleteShaders(), slr::SlrShaderGroup< ShaderT >::output, slr::SlrShaderGroup< ShaderT >::propertyHash, slr::SlrShaderGroup< ShaderT >::shaders, surfaceGroup, and slr::SlrShaderGroup< ShaderT >::topologyHash.



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