HDK
|
#include <LightHandler.h>
Public Member Functions | |
LightHandler () | |
virtual | ~LightHandler () |
Global State | |
void | setLightTransform (const Matrix44 &mat) |
Set the light transform. More... | |
Matrix44 | getLightTransform () const |
Return the light transform. More... | |
void | setDirectLighting (bool enable) |
Set whether direct lighting is enabled. More... | |
bool | getDirectLighting () const |
Return whether direct lighting is enabled. More... | |
void | setIndirectLighting (bool enable) |
Set whether indirect lighting is enabled. More... | |
bool | getIndirectLighting () const |
Return whether indirect lighting is enabled. More... | |
Environment Lighting | |
void | setEnvRadianceMap (ImagePtr map) |
Set the environment radiance map. More... | |
ImagePtr | getEnvRadianceMap () const |
Return the environment radiance map. More... | |
void | setEnvIrradianceMap (ImagePtr map) |
Set the environment irradiance map. More... | |
ImagePtr | getEnvIrradianceMap () const |
Return the environment irradiance map. More... | |
void | setEnvSampleCount (int count) |
Set the environment lighting sample count. More... | |
int | getEnvSampleCount () const |
Return the environment lighting sample count. More... | |
void | setRefractionTwoSided (bool enable) |
Set the two-sided refraction property. More... | |
int | getRefractionTwoSided () const |
Return the two-sided refraction property. More... | |
Albedo Table | |
void | setAlbedoTable (ImagePtr table) |
Set the directional albedo table. More... | |
ImagePtr | getAlbedoTable () const |
Return the directional albedo table. More... | |
Light Sources | |
void | addLightSource (NodePtr node) |
Add a light source. More... | |
void | setLightSources (const vector< NodePtr > &lights) |
Set the vector of light sources. More... | |
const vector< NodePtr > & | getLightSources () const |
Return the vector of light sources. More... | |
NodePtr | getFirstLightOfCategory (const string &category) |
Return the first light source, if any, of the given category. More... | |
Light IDs | |
const std::unordered_map < string, unsigned int > & | getLightIdMap () const |
Get a list of identifiers associated with a given light nodedef. More... | |
LightIdMap | computeLightIdMap (const vector< NodePtr > &nodes) |
void | findLights (DocumentPtr doc, vector< NodePtr > &lights) |
void | registerLights (DocumentPtr doc, const vector< NodePtr > &lights, GenContext &context) |
Static Public Member Functions | |
static LightHandlerPtr | create () |
Create a new light handler. More... | |
Protected Attributes | |
Matrix44 | _lightTransform |
bool | _directLighting |
bool | _indirectLighting |
ImagePtr | _envRadianceMap |
ImagePtr | _envIrradianceMap |
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.
Definition at line 33 of file LightHandler.h.
|
inline |
Definition at line 36 of file LightHandler.h.
|
inlinevirtual |
Definition at line 44 of file LightHandler.h.
LightIdMap LightHandler::computeLightIdMap | ( | const vector< NodePtr > & | nodes | ) |
From a set of nodes, create a mapping of corresponding nodedef identifiers to numbers
|
inlinestatic |
Create a new light handler.
Definition at line 47 of file LightHandler.h.
void LightHandler::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 |
|
inline |
Return the directional albedo table.
Definition at line 151 of file LightHandler.h.
|
inline |
Return whether direct lighting is enabled.
Definition at line 71 of file LightHandler.h.
|
inline |
Return the environment irradiance map.
Definition at line 111 of file LightHandler.h.
|
inline |
Return the environment radiance map.
Definition at line 99 of file LightHandler.h.
|
inline |
Return the environment lighting sample count.
Definition at line 123 of file LightHandler.h.
Return the first light source, if any, of the given category.
Definition at line 176 of file LightHandler.h.
|
inline |
Return whether indirect lighting is enabled.
Definition at line 83 of file LightHandler.h.
Get a list of identifiers associated with a given light nodedef.
Definition at line 193 of file LightHandler.h.
Return the vector of light sources.
Definition at line 170 of file LightHandler.h.
|
inline |
Return the light transform.
Definition at line 59 of file LightHandler.h.
|
inline |
Return the two-sided refraction property.
Definition at line 135 of file LightHandler.h.
void LightHandler::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 |
Set the directional albedo table.
Definition at line 145 of file LightHandler.h.
|
inline |
Set whether direct lighting is enabled.
Definition at line 65 of file LightHandler.h.
Set the environment irradiance map.
Definition at line 105 of file LightHandler.h.
Set the environment radiance map.
Definition at line 93 of file LightHandler.h.
Set the environment lighting sample count.
Definition at line 117 of file LightHandler.h.
|
inline |
Set whether indirect lighting is enabled.
Definition at line 77 of file LightHandler.h.
Set the vector of light sources.
Definition at line 164 of file LightHandler.h.
Set the light transform.
Definition at line 53 of file LightHandler.h.
|
inline |
Set the two-sided refraction property.
Definition at line 129 of file LightHandler.h.
|
protected |
Definition at line 226 of file LightHandler.h.
|
protected |
Definition at line 217 of file LightHandler.h.
|
protected |
Definition at line 221 of file LightHandler.h.
|
protected |
Definition at line 220 of file LightHandler.h.
|
protected |
Definition at line 222 of file LightHandler.h.
|
protected |
Definition at line 218 of file LightHandler.h.
Definition at line 229 of file LightHandler.h.
|
protected |
Definition at line 228 of file LightHandler.h.
|
protected |
Definition at line 216 of file LightHandler.h.
|
protected |
Definition at line 224 of file LightHandler.h.