HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStSurfaceShader Class Reference

#include <surfaceShader.h>

+ Inheritance diagram for HdStSurfaceShader:

Public Member Functions

HDST_API HdStSurfaceShader ()
 
HDST_API ~HdStSurfaceShader () override
 
- Public Member Functions inherited from HdStShaderCode
HDST_API HdStShaderCode ()
 
virtual HDST_API ~HdStShaderCode ()
 

HdShader Virtual Interface //

HDST_API std::string GetSource (TfToken const &shaderStageKey) const override
 Setter method for prim. More...
 
HDST_API
HdSt_MaterialParamVector const
GetParams () const override
 Setter method for prim. More...
 
HDST_API void SetEnabledPrimvarFiltering (bool enabled)
 Setter method for prim. More...
 
HDST_API bool IsEnabledPrimvarFiltering () const override
 Setter method for prim. More...
 
HDST_API TfTokenVector constGetPrimvarNames () const override
 Setter method for prim. More...
 
HDST_API
HdBufferArrayRangeSharedPtr
const
GetShaderData () const override
 Setter method for prim. More...
 
HDST_API TextureDescriptorVector GetTextures () const override
 Setter method for prim. More...
 
HDST_API
NamedTextureHandleVector const
GetNamedTextureHandles () const override
 Setter method for prim. More...
 
HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Setter method for prim. More...
 
HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Setter method for prim. More...
 
HDST_API void AddBindings (HdBindingRequestVector *customBindings) override
 Setter method for prim. More...
 
HDST_API ID ComputeHash () const override
 Setter method for prim. More...
 
HDST_API ID ComputeTextureSourceHash () const override
 Setter method for prim. More...
 
HDST_API TfToken GetMaterialTag () const override
 Setter method for prim. More...
 
HDST_API void SetFragmentSource (const std::string &source)
 Setter method for prim. More...
 
HDST_API void SetGeometrySource (const std::string &source)
 Setter method for prim. More...
 
HDST_API void SetParams (const HdSt_MaterialParamVector &params)
 Setter method for prim. More...
 
HDST_API void SetTextureDescriptors (const TextureDescriptorVector &texDesc)
 Setter method for prim. More...
 
HDST_API void SetNamedTextureHandles (const NamedTextureHandleVector &)
 Setter method for prim. More...
 
HDST_API void SetBufferSources (HdBufferSpecVector const &bufferSpecs, HdBufferSourceSharedPtrVector &&bufferSources, HdStResourceRegistrySharedPtr const &resourceRegistry)
 Setter method for prim. More...
 
HDST_API void AddResourcesFromTextures (ResourceContext &ctx) const override
 
HDST_API void SetMaterialTag (TfToken const &materialTag)
 Setter method for prim. More...
 
virtual HDST_API void Reload ()
 If the prim is based on asset, reload that asset. More...
 
static HDST_API bool CanAggregate (HdStShaderCodeSharedPtr const &shaderA, HdStShaderCodeSharedPtr const &shaderB)
 Returns if the two shaders can be aggregated into the same draw batch. More...
 
static HDST_API void AddFallbackValueToSpecsAndSources (const HdSt_MaterialParam &param, HdBufferSpecVector *const specs, HdBufferSourceSharedPtrVector *const sources)
 
HDST_API void _SetSource (TfToken const &shaderStageKey, std::string const &source)
 Setter method for prim. More...
 
HDST_API ID _ComputeHash () const
 Setter method for prim. More...
 
HDST_API ID _ComputeTextureSourceHash () const
 Setter method for prim. More...
 

Additional Inherited Members

- Public Types inherited from HdStShaderCode
typedef size_t ID
 
typedef std::vector
< TextureDescriptor
TextureDescriptorVector
 
using NamedTextureHandleVector = std::vector< NamedTextureHandle >
 
- Static Public Member Functions inherited from HdStShaderCode
static HDST_API ID ComputeHash (HdStShaderCodeSharedPtrVector const &shaders)
 Returns the combined hash values of multiple shaders. More...
 

Detailed Description

A scene-based SurfaceShader object.

When surface shaders are expresed in the scene graph, the HdSceneDelegate can use this object to express these surface shaders in Storm. In addition to the shader itself, a binding from the Rprim to the SurfaceShader must be expressed as well.

Definition at line 63 of file surfaceShader.h.

Constructor & Destructor Documentation

HDST_API HdStSurfaceShader::HdStSurfaceShader ( )
HDST_API HdStSurfaceShader::~HdStSurfaceShader ( )
override

Member Function Documentation

HDST_API ID HdStSurfaceShader::_ComputeHash ( ) const
protected

Setter method for prim.

HDST_API ID HdStSurfaceShader::_ComputeTextureSourceHash ( ) const
protected

Setter method for prim.

HDST_API void HdStSurfaceShader::_SetSource ( TfToken const shaderStageKey,
std::string const source 
)
protected

Setter method for prim.

HDST_API void HdStSurfaceShader::AddBindings ( HdBindingRequestVector customBindings)
overridevirtual

Setter method for prim.

Implements HdStShaderCode.

static HDST_API void HdStSurfaceShader::AddFallbackValueToSpecsAndSources ( const HdSt_MaterialParam &  param,
HdBufferSpecVector *const  specs,
HdBufferSourceSharedPtrVector *const  sources 
)
static

Adds the fallback value of the given material param to buffer specs and sources using the param's name.

HDST_API void HdStSurfaceShader::AddResourcesFromTextures ( ResourceContext ctx) const
overridevirtual

Called after textures have been committed.

Shader can return buffer sources for different BARs (most likely, the shader bar) that require texture metadata such as the bindless texture handle which is only available after the commit.

Reimplemented from HdStShaderCode.

HDST_API void HdStSurfaceShader::BindResources ( int  program,
HdSt_ResourceBinder const binder,
HdRenderPassState const state 
)
overridevirtual

Setter method for prim.

Implements HdStShaderCode.

static HDST_API bool HdStSurfaceShader::CanAggregate ( HdStShaderCodeSharedPtr const shaderA,
HdStShaderCodeSharedPtr const shaderB 
)
static

Returns if the two shaders can be aggregated into the same draw batch.

HDST_API ID HdStSurfaceShader::ComputeHash ( ) const
overridevirtual

Setter method for prim.

Implements HdStShaderCode.

HDST_API ID HdStSurfaceShader::ComputeTextureSourceHash ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API TfToken HdStSurfaceShader::GetMaterialTag ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API NamedTextureHandleVector const& HdStSurfaceShader::GetNamedTextureHandles ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API HdSt_MaterialParamVector const& HdStSurfaceShader::GetParams ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API TfTokenVector const& HdStSurfaceShader::GetPrimvarNames ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API HdBufferArrayRangeSharedPtr const& HdStSurfaceShader::GetShaderData ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API std::string HdStSurfaceShader::GetSource ( TfToken const shaderStageKey) const
overridevirtual

Setter method for prim.

Implements HdStShaderCode.

HDST_API TextureDescriptorVector HdStSurfaceShader::GetTextures ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

HDST_API bool HdStSurfaceShader::IsEnabledPrimvarFiltering ( ) const
overridevirtual

Setter method for prim.

Reimplemented from HdStShaderCode.

virtual HDST_API void HdStSurfaceShader::Reload ( )
virtual

If the prim is based on asset, reload that asset.

Reimplemented in HdStGLSLFXShader.

HDST_API void HdStSurfaceShader::SetBufferSources ( HdBufferSpecVector const bufferSpecs,
HdBufferSourceSharedPtrVector &&  bufferSources,
HdStResourceRegistrySharedPtr const resourceRegistry 
)

Setter method for prim.

HDST_API void HdStSurfaceShader::SetEnabledPrimvarFiltering ( bool  enabled)

Setter method for prim.

HDST_API void HdStSurfaceShader::SetFragmentSource ( const std::string source)

Setter method for prim.

HDST_API void HdStSurfaceShader::SetGeometrySource ( const std::string source)

Setter method for prim.

HDST_API void HdStSurfaceShader::SetMaterialTag ( TfToken const materialTag)

Setter method for prim.

HDST_API void HdStSurfaceShader::SetNamedTextureHandles ( const NamedTextureHandleVector )

Setter method for prim.

HDST_API void HdStSurfaceShader::SetParams ( const HdSt_MaterialParamVector params)

Setter method for prim.

HDST_API void HdStSurfaceShader::SetTextureDescriptors ( const TextureDescriptorVector texDesc)

Setter method for prim.

HDST_API void HdStSurfaceShader::UnbindResources ( int  program,
HdSt_ResourceBinder const binder,
HdRenderPassState const state 
)
overridevirtual

Setter method for prim.

Implements HdStShaderCode.


The documentation for this class was generated from the following file: