Loading...
Searching...
No Matches
meshLightResolvingSceneIndex.h
1//
2// Copyright 2022 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6#ifndef EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H
7#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H
8
9#include "pxr/pxr.h"
10#include "pxr/imaging/hd/filteringSceneIndex.h"
11
12
13PXR_NAMESPACE_OPEN_SCOPE
14
15TF_DECLARE_REF_PTRS(HdPrmanMeshLightResolvingSceneIndex);
16
17// Pixar-only, Prman-specific Hydra scene index to resolve mesh lights.
18class HdPrmanMeshLightResolvingSceneIndex :
20{
21public:
22 static HdPrmanMeshLightResolvingSceneIndexRefPtr
23 New(const HdSceneIndexBaseRefPtr& inputSceneIndex,
24 const bool disableDeformationMotionBlur = false);
25
26 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
27 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
28
29protected:
30 HdPrmanMeshLightResolvingSceneIndex(
31 const HdSceneIndexBaseRefPtr& inputSceneIndex,
32 const bool disableDeformationMotionBlur = false);
33 ~HdPrmanMeshLightResolvingSceneIndex();
34
35 void _PrimsAdded(
36 const HdSceneIndexBase &sender,
37 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
38
39 void _PrimsRemoved(
40 const HdSceneIndexBase &sender,
41 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
42
43 void _PrimsDirtied(
44 const HdSceneIndexBase &sender,
45 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
46
47private:
48 void _AddMeshLight(
49 const SdfPath& primPath,
50 const HdSceneIndexPrim& prim,
52
53 void _RemoveMeshLight(
54 const SdfPath& primPath,
56
57private:
58 std::unordered_map<SdfPath, bool, SdfPath::Hash> _meshLights;
59
60 // TODO: Remove this option once RIS has been deprecated.
61 bool _disableDeformationMotionBlur;
62};
63
64PXR_NAMESPACE_CLOSE_SCOPE
65
66#endif //EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H
Abstract interface to scene data.
Definition sceneIndex.h:55
An abstract base class for a filtering scene index that observes a single input scene index.
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition declarePtrs.h:58
Small struct representing a 'prim' in the Hydra scene index.
Definition sceneIndex.h:36