7#ifndef PXR_IMAGING_GLF_SIMPLE_LIGHT_H
8#define PXR_IMAGING_GLF_SIMPLE_LIGHT_H
13#include "pxr/imaging/glf/api.h"
17#include "pxr/usd/sdf/path.h"
26PXR_NAMESPACE_OPEN_SCOPE
29class GlfSimpleLight final {
32 GlfSimpleLight(
GfVec4f const & position =
GfVec4f(0.0, 0.0, 0.0, 1.0));
43 GfVec4f const & GetAmbient()
const;
45 void SetAmbient(
GfVec4f const & ambient);
49 GfVec4f const & GetDiffuse()
const;
51 void SetDiffuse(
GfVec4f const & diffuse);
55 GfVec4f const & GetSpecular()
const;
57 void SetSpecular(
GfVec4f const & specular);
60 GfVec4f const & GetPosition()
const;
62 void SetPosition(
GfVec4f const & position);
65 GfVec3f const & GetSpotDirection()
const;
67 void SetSpotDirection(
GfVec3f const & spotDirection);
70 float const & GetSpotCutoff()
const;
72 void SetSpotCutoff(
float const & spotCutoff);
75 float const & GetSpotFalloff()
const;
77 void SetSpotFalloff(
float const & spotFalloff);
80 GfVec3f const & GetAttenuation()
const;
82 void SetAttenuation(
GfVec3f const & attenuation);
85 std::vector<GfMatrix4d>
const & GetShadowMatrices()
const;
87 void SetShadowMatrices(std::vector<GfMatrix4d>
const &matrix);
90 int GetShadowResolution()
const;
92 void SetShadowResolution(
int resolution);
95 float GetShadowBias()
const;
97 void SetShadowBias(
float bias);
100 float GetShadowBlur()
const;
102 void SetShadowBlur(
float blur);
105 int GetShadowIndexStart()
const;
107 void SetShadowIndexStart(
int shadowStart);
110 int GetShadowIndexEnd()
const;
112 void SetShadowIndexEnd(
int shadowEnd);
115 bool HasShadow()
const;
117 void SetHasShadow(
bool hasShadow);
120 bool HasIntensity()
const;
122 void SetHasIntensity(
bool hasIntensity);
125 bool IsCameraSpaceLight()
const;
128 void SetIsCameraSpaceLight(
bool isCameraSpaceLight);
132 void SetID(
SdfPath const &
id);
135 bool IsDomeLight()
const;
137 void SetIsDomeLight(
bool isDomeLight);
158 TfToken const & GetPostSurfaceIdentifier()
const;
160 std::string
const & GetPostSurfaceShaderSource()
const;
162 VtUCharArray
const & GetPostSurfaceShaderParams()
const;
165 void SetPostSurfaceParams(
TfToken const & identifier,
166 std::string
const & shaderSource,
167 VtUCharArray
const & shaderParams);
172 bool operator ==(GlfSimpleLight
const &other)
const;
174 bool operator !=(GlfSimpleLight
const &other)
const;
178 friend std::ostream & operator <<(std::ostream &out,
179 const GlfSimpleLight& v);
188 bool _isCameraSpaceLight;
192 int _shadowResolution;
195 int _shadowIndexStart;
199 std::vector<GfMatrix4d> _shadowMatrices;
206 TfToken _postSurfaceIdentifier;
207 std::string _postSurfaceShaderSource;
208 VtUCharArray _postSurfaceShaderParams;
215std::ostream& operator<<(std::ostream& out,
const GlfSimpleLight& v);
217typedef std::vector<class GlfSimpleLight> GlfSimpleLightVector;
221std::ostream& operator<<(std::ostream& out,
const GlfSimpleLightVector& pv);
224PXR_NAMESPACE_CLOSE_SCOPE
Stores a 4x4 matrix of double elements.
Basic type for a vector of 3 float components.
Basic type for a vector of 4 float components.
Contains an asset path and optional evaluated and resolved paths.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...