Loading...
Searching...
No Matches
light.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_IMAGING_HD_LIGHT_H
25#define PXR_IMAGING_HD_LIGHT_H
26
27#include "pxr/pxr.h"
28#include "pxr/imaging/hd/api.h"
29#include "pxr/imaging/hd/version.h"
30#include "pxr/imaging/hd/sprim.h"
31
33
34#include <vector>
35
36PXR_NAMESPACE_OPEN_SCOPE
37
38#define HD_LIGHT_TOKENS \
39 (angle) \
40 (color) \
41 (colorTemperature) \
42 (enableColorTemperature) \
43 (domeOffset) \
44 (exposure) \
45 (height) \
46 (intensity) \
47 (radius) \
48 (length) \
49 ((textureFile, "texture:file")) \
50 ((textureFormat, "texture:format")) \
51 (width) \
52 (ambient) \
53 (diffuse) \
54 (specular) \
55 (normalize) \
56 (hasShadow) \
57 ((shapingFocus, "shaping:focus")) \
58 ((shapingFocusTint, "shaping:focusTint")) \
59 ((shapingConeAngle, "shaping:cone:angle")) \
60 ((shapingConeSoftness, "shaping:cone:softness")) \
61 ((shapingIesFile, "shaping:ies:file")) \
62 ((shapingIesAngleScale, "shaping:ies:angleScale")) \
63 ((shapingIesNormalize, "shaping:ies:normalize")) \
64 ((shadowEnable, "shadow:enable")) \
65 ((shadowColor, "shadow:color")) \
66 ((shadowDistance, "shadow:distance")) \
67 ((shadowFalloff, "shadow:falloff")) \
68 ((shadowFalloffGamma, "shadow:falloffGamma")) \
69 \
70 (params) \
71 (shadowCollection) \
72 (shadowParams)
73
74TF_DECLARE_PUBLIC_TOKENS(HdLightTokens, HD_API, HD_LIGHT_TOKENS);
75
76class HdSceneDelegate;
77using HdLightPtrConstVector = std::vector<class HdLight const *>;
78
83class HdLight : public HdSprim
84{
85public:
86 HD_API
87 HdLight(SdfPath const & id);
88 HD_API
89 ~HdLight() override;
90
91 // Change tracking for HdLight
92 enum DirtyBits : HdDirtyBits {
93 Clean = 0,
94 DirtyTransform = 1 << 0,
95 DirtyParams = 1 << 1,
96 DirtyShadowParams = 1 << 2,
97 DirtyCollection = 1 << 3,
98 DirtyResource = 1 << 4,
99
100 // XXX: This flag is important for instanced lights, and must have
101 // the same value as it does for Rprims
102 DirtyInstancer = 1 << 16,
103 AllDirty = (DirtyTransform
104 |DirtyParams
105 |DirtyShadowParams
106 |DirtyCollection
107 |DirtyResource
108 |DirtyInstancer)
109 };
110
111 HD_API
112 static std::string StringifyDirtyBits(HdDirtyBits dirtyBits);
113
116 const SdfPath& GetInstancerId() const { return _instancerId; }
117
118 HD_API
119 void _UpdateInstancer(
120 HdSceneDelegate* sceneDelegate,
121 HdDirtyBits* dirtyBits);
122
123private:
124 SdfPath _instancerId;
125};
126
127PXR_NAMESPACE_CLOSE_SCOPE
128
129#endif // PXR_IMAGING_HD_LIGHT_H
A light model, used in conjunction with HdRenderPass.
Definition: light.h:84
const SdfPath & GetInstancerId() const
Returns the identifier of the instancer (if any) for this Sprim.
Definition: light.h:116
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:52
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
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:98