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 HdSt_MaterialNetworkShaderSharedPtr =
39 std::shared_ptr<class HdSt_MaterialNetworkShader>;
46 HF_MALLOC_TAG_NEW(
"new HdStMaterial");
56 HdSt_MaterialParamVector params;
60 HdStMaterial(
SdfPath const&
id);
62 ~HdStMaterial()
override;
68 HdDirtyBits *dirtyBits)
override;
82 HdSt_MaterialNetworkShaderSharedPtr GetMaterialNetworkShader()
const;
92 inline bool HasPtex()
const;
95 inline bool HasLimitSurfaceEvaluation()
const;
98 inline bool HasDisplacement()
const;
101 inline const TfToken& GetMaterialTag()
const;
107 void SetMaterialNetworkShader(
108 HdSt_MaterialNetworkShaderSharedPtr &shaderCode);
116 void _ProcessTextureDescriptors(
118 HdStResourceRegistrySharedPtr
const& resourceRegistry,
119 std::weak_ptr<HdStShaderCode>
const &shaderCode,
120 HdStMaterialNetwork::TextureDescriptorVector
const &descs,
121 HdStShaderCode::NamedTextureHandleVector * texturesFromStorm,
122 HdBufferSpecVector * specs,
123 HdBufferSourceSharedPtrVector * sources);
126 _GetHasLimitSurfaceEvaluation(
VtDictionary const & metadata)
const;
128 void _InitFallbackShader();
132 HdSt_MaterialNetworkShaderSharedPtr _materialNetworkShader;
135 bool _isInitialized : 1;
137 bool _hasLimitSurfaceEvaluation : 1;
138 bool _hasDisplacement : 1;
146 inline bool HdStMaterial::HasPtex()
const 151 inline bool HdStMaterial::HasLimitSurfaceEvaluation()
const 153 return _hasLimitSurfaceEvaluation;
156 inline bool HdStMaterial::HasDisplacement()
const 158 return _hasDisplacement;
161 inline const TfToken& HdStMaterial::GetMaterialTag()
const 167 HdStMaterial::GetVolumeMaterialData()
const {
168 return _volumeMaterialData;
172 PXR_NAMESPACE_CLOSE_SCOPE
174 #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 ...
For volumes, the corresponding draw items do not use the HdStShaderCode produced by HdStMaterial.
Token for efficient comparison, assignment, and hashing of known strings.
Adapter class providing data exchange with the client scene graph.
std::string source
glslfx source code for volume
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.