All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
light.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_LIGHT_H
8#define PXR_IMAGING_HD_LIGHT_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/sprim.h"
14
16
17#include <vector>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
21#define HD_LIGHT_TOKENS \
22 (angle) \
23 (color) \
24 (colorTemperature) \
25 (enableColorTemperature) \
26 (domeOffset) \
27 (exposure) \
28 (height) \
29 (intensity) \
30 (radius) \
31 (length) \
32 ((textureFile, "texture:file")) \
33 ((textureFormat, "texture:format")) \
34 (width) \
35 (ambient) \
36 (diffuse) \
37 (specular) \
38 (normalize) \
39 (hasShadow) \
40 ((shapingFocus, "shaping:focus")) \
41 ((shapingFocusTint, "shaping:focusTint")) \
42 ((shapingConeAngle, "shaping:cone:angle")) \
43 ((shapingConeSoftness, "shaping:cone:softness")) \
44 ((shapingIesFile, "shaping:ies:file")) \
45 ((shapingIesAngleScale, "shaping:ies:angleScale")) \
46 ((shapingIesNormalize, "shaping:ies:normalize")) \
47 ((shadowEnable, "shadow:enable")) \
48 ((shadowColor, "shadow:color")) \
49 ((shadowDistance, "shadow:distance")) \
50 ((shadowFalloff, "shadow:falloff")) \
51 ((shadowFalloffGamma, "shadow:falloffGamma")) \
52 \
53 (params) \
54 (shadowCollection) \
55 (shadowParams)
56
57TF_DECLARE_PUBLIC_TOKENS(HdLightTokens, HD_API, HD_LIGHT_TOKENS);
58
59class HdSceneDelegate;
60using HdLightPtrConstVector = std::vector<class HdLight const *>;
61
66class HdLight : public HdSprim
67{
68public:
69 HD_API
70 HdLight(SdfPath const & id);
71 HD_API
72 ~HdLight() override;
73
74 // Change tracking for HdLight
75 enum DirtyBits : HdDirtyBits {
76 Clean = 0,
77 DirtyTransform = 1 << 0,
78 // Note: Because DirtyVisibility wasn't added, DirtyParams does double
79 // duty for params and visibility.
80 DirtyParams = 1 << 1,
81 DirtyShadowParams = 1 << 2,
82 DirtyCollection = 1 << 3,
83 DirtyResource = 1 << 4,
84
85 // XXX: This flag is important for instanced lights, and must have
86 // the same value as it does for Rprims
87 DirtyInstancer = 1 << 16,
88 AllDirty = (DirtyTransform
89 |DirtyParams
90 |DirtyShadowParams
91 |DirtyCollection
92 |DirtyResource
93 |DirtyInstancer)
94 };
95
96 HD_API
97 static std::string StringifyDirtyBits(HdDirtyBits dirtyBits);
98
101 const SdfPath& GetInstancerId() const { return _instancerId; }
102
103 HD_API
104 void _UpdateInstancer(
105 HdSceneDelegate* sceneDelegate,
106 HdDirtyBits* dirtyBits);
107
108private:
109 SdfPath _instancerId;
110};
111
112PXR_NAMESPACE_CLOSE_SCOPE
113
114#endif // PXR_IMAGING_HD_LIGHT_H
A light model, used in conjunction with HdRenderPass.
Definition: light.h:67
const SdfPath & GetInstancerId() const
Returns the identifier of the instancer (if any) for this Sprim.
Definition: light.h:101
Adapter class providing data exchange with the client scene graph.
Sprim (state prim) is a base class of managing state for non-drawable scene entity (e....
Definition: sprim.h:35
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81