![]() |
MaterialX 1.39.4
|
Utility light handler for creating and providing light data for shader binding. More...
#include <LightHandler.h>
Public Member Functions | |
Global State | |
| void | setLightTransform (const Matrix44 &mat) |
| Set the light transform. | |
| Matrix44 | getLightTransform () const |
| Return the light transform. | |
| void | setDirectLighting (bool enable) |
| Set whether direct lighting is enabled. | |
| bool | getDirectLighting () const |
| Return whether direct lighting is enabled. | |
| void | setIndirectLighting (bool enable) |
| Set whether indirect lighting is enabled. | |
| bool | getIndirectLighting () const |
| Return whether indirect lighting is enabled. | |
Environment Lighting | |
| void | setEnvRadianceMap (ImagePtr map) |
| Set the environment radiance map. | |
| ImagePtr | getEnvRadianceMap () const |
| Return the environment radiance map. | |
| void | setEnvPrefilteredMap (ImagePtr map) |
| Set the environment radiance map for the prefiltered environment lighting model. | |
| ImagePtr | getEnvPrefilteredMap () const |
| Return the environment radiance map for the prefiltered environment lighting model. | |
| void | setUsePrefilteredMap (bool val) |
| Set whether to use the prefiltered environment lighting model. | |
| bool | getUsePrefilteredMap () |
| Return whether to use the prefiltered environment lighting model. | |
| void | setEnvIrradianceMap (ImagePtr map) |
| Set the environment irradiance map. | |
| ImagePtr | getEnvIrradianceMap () const |
| Return the environment irradiance map. | |
| void | setEnvSampleCount (int count) |
| Set the environment lighting sample count. | |
| int | getEnvSampleCount () const |
| Return the environment lighting sample count. | |
| void | setEnvLightIntensity (const float intensity) |
| Set the environment light intensity. | |
| float | getEnvLightIntensity () |
| Return the environment light intensity. | |
| void | setRefractionTwoSided (bool enable) |
| Set the two-sided refraction property. | |
| int | getRefractionTwoSided () const |
| Return the two-sided refraction property. | |
Albedo Table | |
| void | setAlbedoTable (ImagePtr table) |
| Set the directional albedo table. | |
| ImagePtr | getAlbedoTable () const |
| Return the directional albedo table. | |
Light Sources | |
| void | addLightSource (NodePtr node) |
| Add a light source. | |
| void | setLightSources (const vector< NodePtr > &lights) |
| Set the vector of light sources. | |
| const vector< NodePtr > & | getLightSources () const |
| Return the vector of light sources. | |
| NodePtr | getFirstLightOfCategory (const string &category) |
| Return the first light source, if any, of the given category. | |
Light IDs | |
| const std::unordered_map< string, unsigned int > & | getLightIdMap () const |
| Get a list of identifiers associated with a given light nodedef. | |
| 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. | |
| void | registerLights (DocumentPtr doc, const vector< NodePtr > &lights, GenContext &context) |
| Register light node definitions and light count with a given generation context. | |
Static Public Member Functions | |
| static LightHandlerPtr | create () |
| Create a new light handler. | |
Protected Attributes | |
| Matrix44 | _lightTransform |
| bool | _directLighting |
| bool | _indirectLighting |
| bool | _usePrefilteredMap |
| ImagePtr | _envRadianceMap |
| ImagePtr | _envPrefilteredMap |
| ImagePtr | _envIrradianceMap |
| float | _envLightIntensity |
| int | _envSampleCount |
| bool | _refractionTwoSided |
| ImagePtr | _albedoTable |
| vector< NodePtr > | _lightSources |
| std::unordered_map< string, unsigned int > | _lightIdMap |
Utility light handler for creating and providing light data for shader binding.
| void findLights | ( | DocumentPtr | doc, |
| vector< NodePtr > & | lights ) |
Find lights to use based on an input document.
| doc | Document to scan for lights |
| lights | List of lights found in document |
| void registerLights | ( | DocumentPtr | doc, |
| const vector< NodePtr > & | lights, | ||
| GenContext & | context ) |
Register light node definitions and light count with a given generation context.
| doc | Document containing light nodes and definitions |
| lights | Lights to register |
| context | Context to update |