Loading...
Searching...
No Matches
HdStSimpleLightingShader Class Reference

A shader that supports simple lighting functionality. More...

#include <simpleLightingShader.h>

+ Inheritance diagram for HdStSimpleLightingShader:

Public Member Functions

HDST_API ID ComputeHash () const override
 HdShader overrides.
 
HDST_API std::string GetSource (TfToken const &shaderStageKey) const override
 Returns the shader source provided by this shader for shaderStageKey.
 
HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder) 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.
 
HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder) override
 Unbinds shader-specific resources.
 
HDST_API void AddBufferBinding (HdStBindingRequest const &req)
 Add a custom binding request for use when this shader executes.
 
HDST_API void RemoveBufferBinding (TfToken const &name)
 Remove name from custom binding.
 
HDST_API void ClearBufferBindings ()
 Clear all custom bindings associated with this shader.
 
HDST_API void AddBindings (HdStBindingRequestVector *customBindings) override
 Add custom bindings (used by codegen)
 
HDST_API void AddResourcesFromTextures (ResourceContext &ctx) const override
 Adds computations to create the dome light textures that are pre-calculated from the environment map texture.
 
HDST_API HdSt_MaterialParamVector const & GetParams () const override
 HdStShaderCode overrides.
 
HDST_API void SetCamera (GfMatrix4d const &worldToViewMatrix, GfMatrix4d const &projectionMatrix) override
 HdStLightingShader overrides.
 
GlfSimpleLightingContextRefPtr GetLightingContext () const
 
HDST_API void AllocateTextureHandles (HdRenderIndex const &renderIndex, const SdfPath &graphPath)
 Allocates texture handles (texture loading happens later during commit) needed for lights.
 
const HdStTextureHandleSharedPtr & GetDomeLightEnvironmentTextureHandle () const
 The dome light environment map used as source for the other dome light textures.
 
HDST_API NamedTextureHandleVector const & GetNamedTextureHandles () const override
 The textures computed from the dome light environment map that the shader needs to bind for the dome light shading.
 
HDST_API const HdStTextureHandleSharedPtr & GetTextureHandle (const TfToken &name) const
 Get one of the textures that need to be computed from the dome light environment map.
 
HDST_API const HdStTextureHandleSharedPtr & GetDomeLightEnvironmentCubemapTextureHandle () const
 The dome light environment cubemap texture generated from the latlong dome light texture.
 
HdRenderPassAovBindingVector const & GetShadowAovBindings ()
 
HDST_API void SetDomeLightCubemapTargetMemory (unsigned int targetMemoryMB)
 
HDST_API void SetMaxLights (uint32_t maxLights)
 
- Public Member Functions inherited from HdStLightingShader
- Public Member Functions inherited from HdStShaderCode
virtual HDST_API ID ComputeTextureSourceHash () const
 Returns the hash value of the paths of the texture prims consumed by this shader.
 
HDST_API VtDictionary GetLayout (TfTokenVector const &shaderStageKeys) const
 Returns the resource layout for the shader stages specified by shaderStageKeys.
 
virtual HDST_API bool IsEnabledPrimvarFiltering () const
 Returns whether primvar filtering is enabled for this shader.
 
virtual HDST_API TfTokenVector const & GetPrimvarNames () const
 Returns the names of primvar that are used by this shader.
 
virtual HDST_API HdBufferArrayRangeSharedPtr const & GetShaderData () const
 Returns a buffer which stores parameter fallback values and texture handles.
 
virtual HDST_API TfToken GetMaterialTag () const
 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.
 

Static Public Member Functions

static HDST_API constexpr uint32_t GetMaxShadows ()
 
- Static Public Member Functions inherited from HdStShaderCode
static HDST_API ID ComputeHash (HdStShaderCodeSharedPtrVector const &shaders)
 Returns the combined hash values of multiple shaders.
 

Additional Inherited Members

- Public Types inherited from HdStShaderCode
typedef size_t ID
 
using NamedTextureHandleVector = std::vector<NamedTextureHandle>
 

Detailed Description

A shader that supports simple lighting functionality.

Definition at line 40 of file simpleLightingShader.h.

Member Function Documentation

◆ AddBindings()

HDST_API void AddBindings ( HdStBindingRequestVector * customBindings)
overridevirtual

Add custom bindings (used by codegen)

Implements HdStShaderCode.

◆ AddBufferBinding()

HDST_API void AddBufferBinding ( HdStBindingRequest const & req)

Add a custom binding request for use when this shader executes.

◆ AddResourcesFromTextures()

HDST_API void AddResourcesFromTextures ( ResourceContext & ctx) const
overridevirtual

Adds computations to create the dome light textures that are pre-calculated from the environment map texture.

Reimplemented from HdStShaderCode.

◆ AllocateTextureHandles()

HDST_API void AllocateTextureHandles ( HdRenderIndex const & renderIndex,
const SdfPath & graphPath )

Allocates texture handles (texture loading happens later during commit) needed for lights.

Call after lighting context has been set or updated in Sync-phase.

◆ BindResources()

HDST_API void BindResources ( int program,
HdSt_ResourceBinder const & binder )
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.

◆ ClearBufferBindings()

HDST_API void ClearBufferBindings ( )

Clear all custom bindings associated with this shader.

◆ ComputeHash()

HDST_API ID ComputeHash ( ) const
overridevirtual

HdShader overrides.

Implements HdStShaderCode.

◆ GetDomeLightEnvironmentCubemapTextureHandle()

HDST_API const HdStTextureHandleSharedPtr & GetDomeLightEnvironmentCubemapTextureHandle ( ) const

The dome light environment cubemap texture generated from the latlong dome light texture.

◆ GetDomeLightEnvironmentTextureHandle()

const HdStTextureHandleSharedPtr & GetDomeLightEnvironmentTextureHandle ( ) const
inline

The dome light environment map used as source for the other dome light textures.

Definition at line 107 of file simpleLightingShader.h.

◆ GetLightingContext()

GlfSimpleLightingContextRefPtr GetLightingContext ( ) const
inline

Definition at line 90 of file simpleLightingShader.h.

◆ GetMaxShadows()

static HDST_API constexpr uint32_t GetMaxShadows ( )
inlinestaticconstexpr

Definition at line 139 of file simpleLightingShader.h.

◆ GetNamedTextureHandles()

HDST_API NamedTextureHandleVector const & GetNamedTextureHandles ( ) const
overridevirtual

The textures computed from the dome light environment map that the shader needs to bind for the dome light shading.

Reimplemented from HdStShaderCode.

◆ GetParams()

HDST_API HdSt_MaterialParamVector const & GetParams ( ) const
overridevirtual

HdStShaderCode overrides.

Reimplemented from HdStShaderCode.

◆ GetShadowAovBindings()

HdRenderPassAovBindingVector const & GetShadowAovBindings ( )
inline

Definition at line 128 of file simpleLightingShader.h.

◆ GetSource()

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

Returns the shader source provided by this shader for shaderStageKey.

Implements HdStShaderCode.

◆ GetTextureHandle()

HDST_API const HdStTextureHandleSharedPtr & GetTextureHandle ( const TfToken & name) const

Get one of the textures that need to be computed from the dome light environment map.

◆ RemoveBufferBinding()

HDST_API void RemoveBufferBinding ( TfToken const & name)

Remove name from custom binding.

◆ SetCamera()

HDST_API void SetCamera ( GfMatrix4d const & worldToViewMatrix,
GfMatrix4d const & projectionMatrix )
overridevirtual

HdStLightingShader overrides.

Implements HdStLightingShader.

◆ UnbindResources()

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

Unbinds shader-specific resources.

Implements HdStShaderCode.


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