Loading...
Searching...
No Matches
renderingColorSpaceSceneIndexPlugin.h
1//
2// Copyright 2026 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDERING_COLOR_SPACE_SCENE_INDEX_PLUGIN_H
8#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDERING_COLOR_SPACE_SCENE_INDEX_PLUGIN_H
9
10#include "pxr/imaging/hd/materialNetworkInterface.h"
11#include "pxr/base/gf/colorSpace.h"
12#include "pxr/base/tf/token.h"
13#include "pxr/pxr.h"
14#if PXR_VERSION >= 2308
15
16#include "pxr/imaging/hd/sceneIndexPlugin.h"
17#include "hdPrman/api.h"
18
19PXR_NAMESPACE_OPEN_SCOPE
20
27class HdPrman_RenderingColorSpaceSceneIndexPlugin :
29{
30public:
31 HdPrman_RenderingColorSpaceSceneIndexPlugin();
32
33 // Callback to allow for remapping of any custom color space names to ones
34 // the ColorSpaceAPI and GfColorSpace can recognize. See GfColorSpace to
35 // see the Color Space names suppored by the ColorSpaceAPI and Gf.
36 using ColorSpaceRemappingCallback = TfToken (*) (const TfToken& csName);
37 static void
38 RegisterColorSpaceRemappingCallback(
39 const ColorSpaceRemappingCallback& callback);
40 static TfToken RemapColorSpaceName(const TfToken& csName);
41
42 // Callback should return true if the material should be excluded from
43 // the Color Space transformations. Otherwise it should return false.
44 using ExcludeMaterialCallback = bool (*)
45 (const HdSceneIndexBaseRefPtr &si,
47 static void
48 RegisterExcludeMaterialCallback(const ExcludeMaterialCallback& callback);
49 static bool ExcludeMaterial(
50 const HdSceneIndexBaseRefPtr &si,
52
53 // Callback to add any custom material filtering. It should return true if
54 // the material network interface has been modified and should no longer
55 // be modified. Otherwise it should return false.
56 using FilterMaterialCallback = bool (*) (
58 const TfToken& terminalNodeName,
59 const GfColorSpace& renderingCS);
60 static void
61 RegisterFilterMaterialCallback(const FilterMaterialCallback& callback);
62 static bool
63 FilterMaterial(
65 const TfToken& terminalNodeName,
66 const GfColorSpace& renderingColorSpace);
67
68 // Callback to add any custom light filtering. It should return true if
69 // the material network interface has been modified and should no longer
70 // be modified. Otherwise it should return false.
71 using FilterLightCallback = bool (*) (
73 const SdfPath& primPath,
74 const TfToken& nodeName,
75 const GfColorSpace& renderingCS);
76 static void
77 RegisterFilterLightCallback(const FilterLightCallback& callback);
78 static bool
79 FilterLight(
81 const SdfPath& primPath,
82 const TfToken& nodeName,
83 const GfColorSpace& renderingColorSpace);
84
85 // Callback should return true if the color space transformation applied by
86 // this scene index should be disabled. Otherwise it should return false.
87 using DisableTransformCallback = bool (*) (const HdSceneIndexBaseRefPtr &si);
88 static void
89 RegisterDisableTransformCallback(const DisableTransformCallback& callback);
90 static bool DisableTransform(const HdSceneIndexBaseRefPtr& si);
91
92
93protected:
94 HdSceneIndexBaseRefPtr _AppendSceneIndex(
95 const HdSceneIndexBaseRefPtr &inputScene,
96 const HdContainerDataSourceHandle &inputArgs) override;
97};
98
99PXR_NAMESPACE_CLOSE_SCOPE
100
101#endif // PXR_VERSION >= 2308
102
103#endif //EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDERING_COLOR_SPACE_SCENE_INDEX_PLUGIN_H
Basic type: ColorSpace.
Definition colorSpace.h:117
Abstract interface for querying and mutating a material network.
A scene index plugin bundles one or more (typically filtering) scene indices together and enables the...
virtual HD_API HdSceneIndexBaseRefPtr _AppendSceneIndex(const HdSceneIndexBaseRefPtr &inputScene, const HdContainerDataSourceHandle &inputArgs)
Subclasses implement this to instantiate one or more scene indicies which take the provided scene as ...
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
Token for efficient comparison, assignment, and hashing of known strings.
Definition token.h:71
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...