MaterialX 1.38.2
Public Member Functions | Static Public Member Functions | List of all members
LightHandler Class Reference

Utility light handler for creating and providing light data for shader binding. More...

#include <LightHandler.h>

Public Member Functions

void addLightSource (NodePtr node)
 Adds a light source node.
 
const vector< NodePtr > & getLightSources () const
 Return the vector of active light sources.
 
NodePtr getFirstLightOfCategory (const string &category)
 Return the first active light source, if any, of the given category.
 
const std::unordered_map< string, unsigned int > & getLightIdentifierMap () const
 Get a list of identifiers associated with a given light nodedef.
 
void setLightSources (const vector< NodePtr > &lights)
 Set the list of light sources.
 
void setEnvRadianceMap (ImagePtr map)
 Set the environment radiance map.
 
ImagePtr getEnvRadianceMap () const
 Return the environment radiance map.
 
void setEnvIrradianceMap (ImagePtr map)
 Set the environment irradiance map.
 
ImagePtr getEnvIrradianceMap () const
 Return the environment irradiance map.
 
void setAlbedoTable (ImagePtr table)
 Set the directional albedo table.
 
ImagePtr getAlbedoTable () const
 Return the directional albedo table.
 
LightIdMap computeLightIdMap (const vector< NodePtr > &nodes)
 From a set of nodes, create a mapping of corresponding nodedef identifiers to numbers.
 
void findLights (DocumentPtr doc, vector< NodePtr > &lights)
 Find lights to use based on an input document. More...
 
void registerLights (DocumentPtr doc, const vector< NodePtr > &lights, GenContext &context)
 Register light node definitions and light count with a given generation context. More...
 

Static Public Member Functions

static LightHandlerPtr create ()
 Create a new light handler.
 

Detailed Description

Utility light handler for creating and providing light data for shader binding.

Member Function Documentation

◆ findLights()

void findLights ( DocumentPtr  doc,
vector< NodePtr > &  lights 
)

Find lights to use based on an input document.

Parameters
docDocument to scan for lights
lightsList of lights found in document

◆ registerLights()

void registerLights ( DocumentPtr  doc,
const vector< NodePtr > &  lights,
GenContext context 
)

Register light node definitions and light count with a given generation context.

Parameters
docDocument containing light nodes and definitions
lightsLights to register
contextContext to update

The documentation for this class was generated from the following files: