24#ifndef PXR_IMAGING_GLF_SIMPLE_LIGHT_H
25#define PXR_IMAGING_GLF_SIMPLE_LIGHT_H
30#include "pxr/imaging/glf/api.h"
34#include "pxr/usd/sdf/path.h"
43PXR_NAMESPACE_OPEN_SCOPE
46class GlfSimpleLight final {
49 GlfSimpleLight(
GfVec4f const & position =
GfVec4f(0.0, 0.0, 0.0, 1.0));
59 GfVec4f const & GetAmbient()
const;
61 void SetAmbient(
GfVec4f const & ambient);
64 GfVec4f const & GetDiffuse()
const;
66 void SetDiffuse(
GfVec4f const & diffuse);
69 GfVec4f const & GetSpecular()
const;
71 void SetSpecular(
GfVec4f const & specular);
74 GfVec4f const & GetPosition()
const;
76 void SetPosition(
GfVec4f const & position);
79 GfVec3f const & GetSpotDirection()
const;
81 void SetSpotDirection(
GfVec3f const & spotDirection);
84 float const & GetSpotCutoff()
const;
86 void SetSpotCutoff(
float const & spotCutoff);
89 float const & GetSpotFalloff()
const;
91 void SetSpotFalloff(
float const & spotFalloff);
94 GfVec3f const & GetAttenuation()
const;
96 void SetAttenuation(
GfVec3f const & attenuation);
99 std::vector<GfMatrix4d>
const & GetShadowMatrices()
const;
101 void SetShadowMatrices(std::vector<GfMatrix4d>
const &matrix);
104 int GetShadowResolution()
const;
106 void SetShadowResolution(
int resolution);
109 float GetShadowBias()
const;
111 void SetShadowBias(
float bias);
114 float GetShadowBlur()
const;
116 void SetShadowBlur(
float blur);
119 int GetShadowIndexStart()
const;
121 void SetShadowIndexStart(
int shadowStart);
124 int GetShadowIndexEnd()
const;
126 void SetShadowIndexEnd(
int shadowEnd);
129 bool HasShadow()
const;
131 void SetHasShadow(
bool hasShadow);
134 bool HasIntensity()
const;
136 void SetHasIntensity(
bool hasIntensity);
139 bool IsCameraSpaceLight()
const;
142 void SetIsCameraSpaceLight(
bool isCameraSpaceLight);
146 void SetID(
SdfPath const &
id);
149 bool IsDomeLight()
const;
151 void SetIsDomeLight(
bool isDomeLight);
172 TfToken const & GetPostSurfaceIdentifier()
const;
174 std::string
const & GetPostSurfaceShaderSource()
const;
176 VtUCharArray
const & GetPostSurfaceShaderParams()
const;
179 void SetPostSurfaceParams(
TfToken const & identifier,
180 std::string
const & shaderSource,
181 VtUCharArray
const & shaderParams);
186 bool operator ==(GlfSimpleLight
const &other)
const;
188 bool operator !=(GlfSimpleLight
const &other)
const;
192 friend std::ostream & operator <<(std::ostream &out,
193 const GlfSimpleLight& v);
202 bool _isCameraSpaceLight;
206 int _shadowResolution;
209 int _shadowIndexStart;
213 std::vector<GfMatrix4d> _shadowMatrices;
220 TfToken _postSurfaceIdentifier;
221 std::string _postSurfaceShaderSource;
222 VtUCharArray _postSurfaceShaderParams;
229std::ostream&
operator<<(std::ostream& out,
const GlfSimpleLight& v);
231typedef std::vector<class GlfSimpleLight> GlfSimpleLightVector;
235std::ostream&
operator<<(std::ostream& out,
const GlfSimpleLightVector& pv);
238PXR_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...