HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dependencySceneIndexPlugin.h
Go to the documentation of this file.
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 
7 #ifndef PXR_IMAGING_HD_ST_DEPENDENCY_SCENE_INDEX_PLUGIN_H
8 #define PXR_IMAGING_HD_ST_DEPENDENCY_SCENE_INDEX_PLUGIN_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hdSt/api.h"
13 
15 
16 /// \class HdSt_DependencySceneIndexPlugin
17 ///
18 /// Plugin adds a scene index that declares Storm-specific dependencies to
19 /// trigger the necessary invalidation.
20 ///
21 /// Currently, the scene index has two uses.
22 ///
23 /// 1) For volumes.
24 /// Specfically, the declaration allows the volumeFieldBinding data source
25 /// locator of a volume prim to be invalidated if any of the targeted volume
26 /// fields changes.
27 /// That is, if, e.g., the filePath of a volume field changes, then the volume
28 /// using that volume field will be dirtied so that HdStVolume will update
29 /// which 3d textures it will use.
30 ///
31 /// 2) For meshes.
32 /// Adding dependency of the material binding on the material datasource
33 /// of the bound material.
34 /// Recall that a mesh has to be quadrangulated if the bound material is using
35 /// any ptex texture. If there is any change to the material, this scene index
36 /// will dirty the mesh's materialBindings locator. This causes a
37 /// HdStMesh::Sync with the HdChangeTracker::DirtyMaterialId dirty bit set so
38 /// the mesh will re-evaluate whether the bound material is using any ptex
39 /// texture.
40 /// Note that this was previously achieved by HdStMaterial::Sync calling
41 /// HdChangeTracker::MarkAllRprimsDirty when a material has changed in such a
42 /// way that the _hasPtex flag has changed.
43 /// HdChangeTracker::MarkAllRprimsDirty, however, only works for prims
44 /// originating from a scene delegate (that is, being added to the legacy
45 /// retained scene index used by emulation). Furthermore, that call did
46 /// do a potentially massive overinvalidation.
47 ///
49 {
50 public:
52 
53 protected:
54  HdSceneIndexBaseRefPtr _AppendSceneIndex(
55  const HdSceneIndexBaseRefPtr &inputScene,
56  const HdContainerDataSourceHandle &inputArgs) override;
57 };
58 
60 
61 #endif // PXR_IMAGING_HD_ST_DEPENDENCY_SCENE_INDEX_PLUGIN_H
HdSceneIndexBaseRefPtr _AppendSceneIndex(const HdSceneIndexBaseRefPtr &inputScene, const HdContainerDataSourceHandle &inputArgs) override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74