7#ifndef PXR_IMAGING_HD_ST_MATERIAL_H
8#define PXR_IMAGING_HD_ST_MATERIAL_H
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/materialNetwork.h"
13#include "pxr/imaging/hdSt/shaderCode.h"
14#include "pxr/imaging/hd/material.h"
15#include "pxr/imaging/hf/perfLog.h"
19PXR_NAMESPACE_OPEN_SCOPE
21using HdSt_MaterialNetworkShaderSharedPtr =
22 std::shared_ptr<class HdSt_MaterialNetworkShader>;
29 HF_MALLOC_TAG_NEW(
"new HdStMaterial");
39 HdSt_MaterialParamVector params;
43 HdStMaterial(
SdfPath const&
id);
45 ~HdStMaterial()
override;
51 HdDirtyBits *dirtyBits)
override;
65 HdSt_MaterialNetworkShaderSharedPtr GetMaterialNetworkShader()
const;
75 inline bool HasPtex()
const;
78 inline bool HasLimitSurfaceEvaluation()
const;
81 inline bool HasDisplacement()
const;
83 inline bool IsUsingFallbackShader()
const;
86 inline const TfToken& GetMaterialTag()
const;
92 void SetMaterialNetworkShader(
93 HdSt_MaterialNetworkShaderSharedPtr &shaderCode);
101 void _ProcessTextureDescriptors(
103 HdStResourceRegistrySharedPtr
const& resourceRegistry,
104 std::weak_ptr<HdStShaderCode>
const &shaderCode,
105 HdStMaterialNetwork::TextureDescriptorVector
const &descs,
106 HdStShaderCode::NamedTextureHandleVector * texturesFromStorm,
107 HdBufferSpecVector * specs,
108 HdBufferSourceSharedPtrVector * sources);
111 _GetHasLimitSurfaceEvaluation(
VtDictionary const & metadata)
const;
113 void _InitFallbackShader();
117 HdSt_MaterialNetworkShaderSharedPtr _materialNetworkShader;
120 bool _isInitialized : 1;
122 bool _hasLimitSurfaceEvaluation : 1;
123 bool _hasDisplacement : 1;
124 bool _isUsingFallbackShader : 1;
132inline bool HdStMaterial::HasPtex()
const
137inline bool HdStMaterial::HasLimitSurfaceEvaluation()
const
139 return _hasLimitSurfaceEvaluation;
142inline bool HdStMaterial::HasDisplacement()
const
144 return _hasDisplacement;
147inline const TfToken& HdStMaterial::GetMaterialTag()
const
152inline bool HdStMaterial::IsUsingFallbackShader()
const
154 return _isUsingFallbackShader;
158HdStMaterial::GetVolumeMaterialData()
const {
159 return _volumeMaterialData;
163PXR_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