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"
36PXR_NAMESPACE_OPEN_SCOPE
38using 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;
146inline bool HdStMaterial::HasPtex()
const
151inline bool HdStMaterial::HasLimitSurfaceEvaluation()
const
153 return _hasLimitSurfaceEvaluation;
156inline bool HdStMaterial::HasDisplacement()
const
158 return _hasDisplacement;
161inline const TfToken& HdStMaterial::GetMaterialTag()
const
167HdStMaterial::GetVolumeMaterialData()
const {
168 return _volumeMaterialData;
172PXR_NAMESPACE_CLOSE_SCOPE
Hydra Schema for a material object.
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.
virtual HD_API void Finalize(HdRenderParam *renderParam)
Finalizes object resources.
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.
Helps HdStMaterial process a Hydra material network into shader source code and parameters values.
A class representing the config and shader source of a glslfx file.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
A map with string keys and VtValue values.
For volumes, the corresponding draw items do not use the HdStShaderCode produced by HdStMaterial.
std::string source
glslfx source code for volume