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

A scene-based SurfaceShader object. More...

+ Inheritance diagram for HdStSurfaceShader:

HdShader Virtual Interface //

virtual HDST_API std::string GetSource (TfToken const &shaderStageKey) const override
 Returns the shader source provided by this shader for shaderStageKey. More...
 
virtual HDST_API
HdMaterialParamVector const & 
GetParams () const override
 Returns the shader parameters for this shader. More...
 
HDST_API void SetEnabledPrimvarFiltering (bool enabled)
 
virtual HDST_API bool IsEnabledPrimvarFiltering () const override
 Returns whether primvar filtering is enabled for this shader. More...
 
virtual HDST_API TfTokenVector
const & 
GetPrimvarNames () const override
 Returns the names of primvar that are used by this shader. More...
 
virtual HDST_API
HdBufferArrayRangeSharedPtr
const & 
GetShaderData () const override
 Returns a buffer which stores parameter fallback values and texture handles. More...
 
virtual HDST_API
TextureDescriptorVector 
GetTextures () const override
 
virtual HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Binds shader-specific resources to program XXX: this interface is meant to be used for bridging the GlfSimpleLightingContext mechanism, and not for generic use-cases. More...
 
virtual HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Unbinds shader-specific resources. More...
 
virtual HDST_API void AddBindings (HdBindingRequestVector *customBindings) override
 Add custom bindings (used by codegen) More...
 
virtual HDST_API ID ComputeHash () const override
 Returns the hash value of this shader. More...
 
virtual HDST_API TfToken GetMaterialTag () const override
 Material tags can be set in the meta-data of a glslfx file to control what rprim collection that prims using this shader should go into. More...
 
HDST_API void SetFragmentSource (const std::string &source)
 Setter method for prim. More...
 
HDST_API void SetGeometrySource (const std::string &source)
 
HDST_API void SetParams (const HdMaterialParamVector &params)
 
HDST_API void SetTextureDescriptors (const TextureDescriptorVector &texDesc)
 
HDST_API void SetBufferSources (HdBufferSourceVector &bufferSources, HdResourceRegistrySharedPtr const &resourceRegistry)
 
HDST_API void SetMaterialTag (TfToken const &materialTag)
 
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...
 
HDST_API void _SetSource (TfToken const &shaderStageKey, std::string const &source)
 
HDST_API ID _ComputeHash () const
 

Additional Inherited Members

- Public Types inherited from HdStShaderCode
typedef size_t ID
 
typedef std::vector
< TextureDescriptor > 
TextureDescriptorVector
 
- 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 61 of file surfaceShader.h.

Member Function Documentation

virtual HDST_API void AddBindings ( HdBindingRequestVector *  customBindings)
overridevirtual

Add custom bindings (used by codegen)

Implements HdStShaderCode.

virtual HDST_API void BindResources ( int  program,
HdSt_ResourceBinder const &  binder,
HdRenderPassState const &  state 
)
overridevirtual

Binds shader-specific resources to program XXX: this interface is meant to be used for bridging the GlfSimpleLightingContext mechanism, and not for generic use-cases.

Implements HdStShaderCode.

static HDST_API bool CanAggregate ( HdStShaderCodeSharedPtr const &  shaderA,
HdStShaderCodeSharedPtr const &  shaderB 
)
static

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

virtual HDST_API ID ComputeHash ( ) const
overridevirtual

Returns the hash value of this shader.

Implements HdStShaderCode.

virtual HDST_API TfToken GetMaterialTag ( ) const
overridevirtual

Material tags can be set in the meta-data of a glslfx file to control what rprim collection that prims using this shader should go into.

E.g. We can use it to split opaque and translucent prims into different collections. When no material tags are specified in the shader, a empty token is returned.

Reimplemented from HdStShaderCode.

virtual HDST_API HdMaterialParamVector const& GetParams ( ) const
overridevirtual

Returns the shader parameters for this shader.

Reimplemented from HdStShaderCode.

virtual HDST_API TfTokenVector const& GetPrimvarNames ( ) const
overridevirtual

Returns the names of primvar that are used by this shader.

Reimplemented from HdStShaderCode.

virtual HDST_API HdBufferArrayRangeSharedPtr const& GetShaderData ( ) const
overridevirtual

Returns a buffer which stores parameter fallback values and texture handles.

Reimplemented from HdStShaderCode.

virtual HDST_API std::string GetSource ( TfToken const &  shaderStageKey) const
overridevirtual

Returns the shader source provided by this shader for shaderStageKey.

Implements HdStShaderCode.

virtual HDST_API bool IsEnabledPrimvarFiltering ( ) const
overridevirtual

Returns whether primvar filtering is enabled for this shader.

Reimplemented from HdStShaderCode.

virtual HDST_API void Reload ( )
virtual

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

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

Setter method for prim.

virtual HDST_API void UnbindResources ( int  program,
HdSt_ResourceBinder const &  binder,
HdRenderPassState const &  state 
)
overridevirtual

Unbinds shader-specific resources.

Implements HdStShaderCode.


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