All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
imageShader.h
1//
2// Copyright 2023 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_IMAGE_SHADER_H
8#define PXR_IMAGING_HD_IMAGE_SHADER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/material.h"
13#include "pxr/imaging/hd/sprim.h"
14#include "pxr/imaging/hd/version.h"
15
18
19PXR_NAMESPACE_OPEN_SCOPE
20
21#define HD_IMAGE_SHADER_TOKENS \
22 (enabled) \
23 (priority) \
24 (filePath) \
25 (constants) \
26 (materialNetwork)
27
28TF_DECLARE_PUBLIC_TOKENS(HdImageShaderTokens, HD_API, HD_IMAGE_SHADER_TOKENS);
29
30class HdSceneDelegate;
31
32using HdMaterialNetworkInterfaceUniquePtr =
33 std::unique_ptr<class HdMaterialNetworkInterface>;
34
39class HdImageShader : public HdSprim
40{
41public:
42 HD_API
43 HdImageShader(SdfPath const & id);
44 HD_API
45 ~HdImageShader() override;
46
47 // Change tracking for HdImageShader
48 enum DirtyBits : HdDirtyBits {
49 Clean = 0,
50 DirtyEnabled = 1 << 0,
51 DirtyPriority = 1 << 1,
52 DirtyFilePath = 1 << 2,
53 DirtyConstants = 1 << 3,
54 DirtyMaterialNetwork = 1 << 4,
55
56 AllDirty = (DirtyEnabled
57 |DirtyPriority
58 |DirtyFilePath
59 |DirtyConstants
60 |DirtyMaterialNetwork)
61 };
62
63 // ---------------------------------------------------------------------- //
65 // ---------------------------------------------------------------------- //
66
68 HD_API
69 void Sync(
70 HdSceneDelegate* sceneDelegate,
71 HdRenderParam* renderParam,
72 HdDirtyBits* dirtyBits) override;
73
77 HD_API
78 HdDirtyBits GetInitialDirtyBitsMask() const override;
79
80 // ---------------------------------------------------------------------- //
82 // ---------------------------------------------------------------------- //
83 HD_API
84 bool GetEnabled() const;
85
86 HD_API
87 int GetPriority() const;
88
89 HD_API
90 const std::string& GetFilePath() const;
91
92 HD_API
93 const VtDictionary& GetConstants() const;
94
95 HD_API
96 const HdMaterialNetworkInterface* GetMaterialNetwork() const;
97
98private:
99 bool _enabled;
100 int _priority;
101 std::string _filePath;
102 VtDictionary _constants;
103 HdMaterialNetwork2 _materialNetwork;
104 HdMaterialNetworkInterfaceUniquePtr _materialNetworkInterface;
105};
106
107PXR_NAMESPACE_CLOSE_SCOPE
108
109#endif // PXR_IMAGING_HD_IMAGE_SHADER_H
An image shader.
Definition: imageShader.h:40
HD_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Sprim API.
HD_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...
HD_API bool GetEnabled() const
Image shader parameters accessor API.
Abstract interface for querying and mutating a material network.
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.
Sprim (state prim) is a base class of managing state for non-drawable scene entity (e....
Definition: sprim.h:35
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
A map with string keys and VtValue values.
Definition: dictionary.h:43
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:81
Container of nodes and top-level terminal connections.
Definition: material.h:161