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));
42 GfVec4f const & GetAmbient()
const;
44 void SetAmbient(
GfVec4f const & ambient);
47 GfVec4f const & GetDiffuse()
const;
49 void SetDiffuse(
GfVec4f const & diffuse);
52 GfVec4f const & GetSpecular()
const;
54 void SetSpecular(
GfVec4f const & specular);
57 GfVec4f const & GetPosition()
const;
59 void SetPosition(
GfVec4f const & position);
62 GfVec3f const & GetSpotDirection()
const;
64 void SetSpotDirection(
GfVec3f const & spotDirection);
67 float const & GetSpotCutoff()
const;
69 void SetSpotCutoff(
float const & spotCutoff);
72 float const & GetSpotFalloff()
const;
74 void SetSpotFalloff(
float const & spotFalloff);
77 GfVec3f const & GetAttenuation()
const;
79 void SetAttenuation(
GfVec3f const & attenuation);
82 std::vector<GfMatrix4d>
const & GetShadowMatrices()
const;
84 void SetShadowMatrices(std::vector<GfMatrix4d>
const &matrix);
87 int GetShadowResolution()
const;
89 void SetShadowResolution(
int resolution);
92 float GetShadowBias()
const;
94 void SetShadowBias(
float bias);
97 float GetShadowBlur()
const;
99 void SetShadowBlur(
float blur);
102 int GetShadowIndexStart()
const;
104 void SetShadowIndexStart(
int shadowStart);
107 int GetShadowIndexEnd()
const;
109 void SetShadowIndexEnd(
int shadowEnd);
112 bool HasShadow()
const;
114 void SetHasShadow(
bool hasShadow);
117 bool HasIntensity()
const;
119 void SetHasIntensity(
bool hasIntensity);
122 bool IsCameraSpaceLight()
const;
125 void SetIsCameraSpaceLight(
bool isCameraSpaceLight);
129 void SetID(
SdfPath const &
id);
132 bool IsDomeLight()
const;
134 void SetIsDomeLight(
bool isDomeLight);
155 TfToken const & GetPostSurfaceIdentifier()
const;
157 std::string
const & GetPostSurfaceShaderSource()
const;
159 VtUCharArray
const & GetPostSurfaceShaderParams()
const;
162 void SetPostSurfaceParams(
TfToken const & identifier,
163 std::string
const & shaderSource,
164 VtUCharArray
const & shaderParams);
169 bool operator ==(GlfSimpleLight
const &other)
const;
171 bool operator !=(GlfSimpleLight
const &other)
const;
175 friend std::ostream & operator <<(std::ostream &out,
176 const GlfSimpleLight& v);
185 bool _isCameraSpaceLight;
189 int _shadowResolution;
192 int _shadowIndexStart;
196 std::vector<GfMatrix4d> _shadowMatrices;
203 TfToken _postSurfaceIdentifier;
204 std::string _postSurfaceShaderSource;
205 VtUCharArray _postSurfaceShaderParams;
212std::ostream&
operator<<(std::ostream& out,
const GlfSimpleLight& v);
214typedef std::vector<class GlfSimpleLight> GlfSimpleLightVector;
218std::ostream&
operator<<(std::ostream& out,
const GlfSimpleLightVector& pv);
221PXR_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 an optional resolved path.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...