24 #ifndef PXR_IMAGING_HD_ST_MATERIAL_H
25 #define PXR_IMAGING_HD_ST_MATERIAL_H
28 #include "pxr/imaging/hdSt/api.h"
29 #include "pxr/imaging/hdSt/materialNetwork.h"
30 #include "pxr/imaging/hdSt/shaderCode.h"
31 #include "pxr/imaging/hd/material.h"
32 #include "pxr/imaging/hf/perfLog.h"
36 PXR_NAMESPACE_OPEN_SCOPE
38 using HdStSurfaceShaderSharedPtr = std::shared_ptr<class HdStSurfaceShader>;
45 HF_MALLOC_TAG_NEW(
"new HdStMaterial");
48 HdStMaterial(
SdfPath const&
id);
50 ~HdStMaterial()
override;
56 HdDirtyBits *dirtyBits)
override;
69 HdStShaderCodeSharedPtr GetShaderCode()
const;
75 inline bool HasPtex()
const;
78 inline bool HasLimitSurfaceEvaluation()
const;
81 inline bool HasDisplacement()
const;
84 inline const TfToken& GetMaterialTag()
const;
90 void SetSurfaceShader(HdStSurfaceShaderSharedPtr &shaderCode);
98 void _ProcessTextureDescriptors(
100 HdStResourceRegistrySharedPtr
const& resourceRegistry,
101 std::weak_ptr<HdStShaderCode>
const &shaderCode,
102 HdStMaterialNetwork::TextureDescriptorVector
const &descs,
103 HdStShaderCode::NamedTextureHandleVector * texturesFromStorm,
104 HdBufferSpecVector * specs,
105 HdBufferSourceSharedPtrVector * sources);
108 _GetHasLimitSurfaceEvaluation(
VtDictionary const & metadata)
const;
110 void _InitFallbackShader();
114 HdStSurfaceShaderSharedPtr _surfaceShader;
116 bool _isInitialized : 1;
118 bool _hasLimitSurfaceEvaluation : 1;
119 bool _hasDisplacement : 1;
127 inline bool HdStMaterial::HasPtex()
const
132 inline bool HdStMaterial::HasLimitSurfaceEvaluation()
const
134 return _hasLimitSurfaceEvaluation;
137 inline bool HdStMaterial::HasDisplacement()
const
139 return _hasDisplacement;
142 inline const TfToken& HdStMaterial::GetMaterialTag()
const
147 PXR_NAMESPACE_CLOSE_SCOPE
149 #endif // PXR_IMAGING_HD_ST_MATERIAL_H
virtual HdDirtyBits GetInitialDirtyBitsMask() const =0
Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of thi...
virtual void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits)=0
Synchronizes state from the delegate to this object.
A map with string keys and VtValue values.
Helps HdStMaterial process a Hydra material network into shader source code and parameters values...
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Token for efficient comparison, assignment, and hashing of known strings.
Adapter class providing data exchange with the client scene graph.
A path value used to locate objects in layers or scenegraphs.
A class representing the config and shader source of a glslfx file.
virtual HD_API void Finalize(HdRenderParam *renderParam)
Finalizes object resources.
Hydra Schema for a material object.