This document is for a version of USD that is under development. See this page for the current release.
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_ST_LIGHT_H
8#define PXR_IMAGING_HD_ST_LIGHT_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/light.h"
14
16
17#include "pxr/base/vt/value.h"
18
19PXR_NAMESPACE_OPEN_SCOPE
20
27class HdStLight final : public HdLight {
28public:
29 HDST_API
30 HdStLight(SdfPath const & id, TfToken const &lightType);
31 HDST_API
32 ~HdStLight() override;
33
35 HDST_API
36 void Sync(HdSceneDelegate *sceneDelegate,
37 HdRenderParam *renderParam,
38 HdDirtyBits *dirtyBits) override;
39
43 HDST_API
44 void Finalize(HdRenderParam *renderParam) override;
45
47 HDST_API
48 VtValue Get(TfToken const &token) const;
49
53 HDST_API
54 HdDirtyBits GetInitialDirtyBitsMask() const override;
55
56private:
57 // Converts area lights (sphere lights and distant lights) into
58 // glfSimpleLights and inserts them in the dictionary so
59 // SimpleLightTask can use them later on as if they were regular lights.
60 GlfSimpleLight _ApproximateAreaLight(SdfPath const &id,
61 HdSceneDelegate *sceneDelegate);
62
63 // Collects data such as the environment map texture path for a
64 // dome light. The lighting shader is responsible for pre-calculating
65 // the different textures needed for IBL.
66 GlfSimpleLight _PrepareDomeLight(SdfPath const &id,
67 HdSceneDelegate *sceneDelegate);
68
69 GlfSimpleLight _PrepareSimpleLight(SdfPath const &id,
70 HdSceneDelegate *sceneDelegate);
71
72private:
73 // Stores the internal light type of this light.
74 TfToken _lightType;
75
76 // Cached states.
77 TfHashMap<TfToken, VtValue, TfToken::HashFunctor> _params;
78};
79
80
81PXR_NAMESPACE_CLOSE_SCOPE
82
83#endif // PXR_IMAGING_HD_ST_LIGHT_H
A light model, used in conjunction with HdRenderPass.
Definition: light.h:67
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Adapter class providing data exchange with the client scene graph.
A light model for use in Storm.
Definition: light.h:27
HDST_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Synchronizes state from the delegate to this object.
HDST_API HdDirtyBits GetInitialDirtyBitsMask() const override
Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of thi...
HDST_API VtValue Get(TfToken const &token) const
Accessor for tasks to get the parameters cached in this object.
HDST_API void Finalize(HdRenderParam *renderParam) override
Finalizes object resources.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147