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;
84 inline const TfToken& GetMaterialTag()
const;
90 void SetMaterialNetworkShader(
91 HdSt_MaterialNetworkShaderSharedPtr &shaderCode);
99 void _ProcessTextureDescriptors(
101 HdStResourceRegistrySharedPtr
const& resourceRegistry,
102 std::weak_ptr<HdStShaderCode>
const &shaderCode,
103 HdStMaterialNetwork::TextureDescriptorVector
const &descs,
104 HdStShaderCode::NamedTextureHandleVector * texturesFromStorm,
105 HdBufferSpecVector * specs,
106 HdBufferSourceSharedPtrVector * sources);
109 _GetHasLimitSurfaceEvaluation(
VtDictionary const & metadata)
const;
111 void _InitFallbackShader();
115 HdSt_MaterialNetworkShaderSharedPtr _materialNetworkShader;
118 bool _isInitialized : 1;
120 bool _hasLimitSurfaceEvaluation : 1;
121 bool _hasDisplacement : 1;
129inline bool HdStMaterial::HasPtex()
const
134inline bool HdStMaterial::HasLimitSurfaceEvaluation()
const
136 return _hasLimitSurfaceEvaluation;
139inline bool HdStMaterial::HasDisplacement()
const
141 return _hasDisplacement;
144inline const TfToken& HdStMaterial::GetMaterialTag()
const
150HdStMaterial::GetVolumeMaterialData()
const {
151 return _volumeMaterialData;
155PXR_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