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

#include <simpleLightingShader.h>

+ Inheritance diagram for HdStSimpleLightingShader:

Public Member Functions

HDST_API HdStSimpleLightingShader ()
HDST_API ~HdStSimpleLightingShader () override
HDST_API ID ComputeHash () const override
 HdShader overrides. More...
HDST_API std::string GetSource (TfToken const &shaderStageKey) const override
HDST_API void BindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
HDST_API void UnbindResources (int program, HdSt_ResourceBinder const &binder, HdRenderPassState const &state) override
 Unbinds shader-specific resources. More...
HDST_API void AddBindings (HdBindingRequestVector *customBindings) override
 Add custom bindings (used by codegen) More...
HDST_API void AddResourcesFromTextures (ResourceContext &ctx) const override
HdSt_MaterialParamVector const
GetParams () const override
 HdStShaderCode overrides. More...
HDST_API void SetCamera (GfMatrix4d const &worldToViewMatrix, GfMatrix4d const &projectionMatrix) override
 HdStLightingShader overrides. More...
HDST_API void SetLightingStateFromOpenGL ()
HDST_API void SetLightingState (GlfSimpleLightingContextPtr const &lightingContext)
GlfSimpleLightingContextRefPtr GetLightingContext () const
HDST_API void AllocateTextureHandles (HdSceneDelegate *delegate)
const HdStTextureHandleSharedPtrGetDomeLightEnvironmentTextureHandle () const
NamedTextureHandleVector const
GetNamedTextureHandles () const override
HDST_API const
GetTextureHandle (const TfToken &name) const
- Public Member Functions inherited from HdStLightingShader
HDST_API HdStLightingShader ()
virtual HDST_API ~HdStLightingShader ()
- Public Member Functions inherited from HdStShaderCode
HDST_API HdStShaderCode ()
virtual HDST_API ~HdStShaderCode ()
virtual ID ComputeTextureSourceHash () const
virtual HDST_API bool IsEnabledPrimvarFiltering () const
 Returns whether primvar filtering is enabled for this shader. More...
virtual HDST_API TfTokenVector
GetPrimvarNames () const
 Returns the names of primvar that are used by this shader. More...
virtual HDST_API
GetShaderData () const
virtual HDST_API TfToken GetMaterialTag () const
virtual HDST_API
GetTextures () const

Additional Inherited Members

- Public Types inherited from HdStShaderCode
typedef size_t ID
typedef std::vector
< TextureDescriptor
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 shader that supports simple lighting functionality.

Definition at line 50 of file simpleLightingShader.h.

Constructor & Destructor Documentation

HDST_API HdStSimpleLightingShader::HdStSimpleLightingShader ( )
HDST_API HdStSimpleLightingShader::~HdStSimpleLightingShader ( )

Member Function Documentation

HDST_API void HdStSimpleLightingShader::AddBindings ( HdBindingRequestVector customBindings)

Add custom bindings (used by codegen)

Implements HdStShaderCode.

HDST_API void HdStSimpleLightingShader::AddResourcesFromTextures ( ResourceContext ctx) const

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

Reimplemented from HdStShaderCode.

HDST_API void HdStSimpleLightingShader::AllocateTextureHandles ( HdSceneDelegate delegate)

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

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

HDST_API void HdStSimpleLightingShader::BindResources ( int  program,
HdSt_ResourceBinder const binder,
HdRenderPassState const state 

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.

HDST_API ID HdStSimpleLightingShader::ComputeHash ( ) const

HdShader overrides.

Implements HdStShaderCode.

const HdStTextureHandleSharedPtr& HdStSimpleLightingShader::GetDomeLightEnvironmentTextureHandle ( ) const

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

Definition at line 108 of file simpleLightingShader.h.

GlfSimpleLightingContextRefPtr HdStSimpleLightingShader::GetLightingContext ( ) const

Definition at line 93 of file simpleLightingShader.h.

HDST_API NamedTextureHandleVector const& HdStSimpleLightingShader::GetNamedTextureHandles ( ) const

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

Reimplemented from HdStShaderCode.

HDST_API HdSt_MaterialParamVector const& HdStSimpleLightingShader::GetParams ( ) const

HdStShaderCode overrides.

Reimplemented from HdStShaderCode.

HDST_API std::string HdStSimpleLightingShader::GetSource ( TfToken const shaderStageKey) const

Returns the shader source provided by this shader for shaderStageKey

Implements HdStShaderCode.

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

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

HDST_API void HdStSimpleLightingShader::SetCamera ( GfMatrix4d const worldToViewMatrix,
GfMatrix4d const projectionMatrix 

HdStLightingShader overrides.

Implements HdStLightingShader.

HDST_API void HdStSimpleLightingShader::SetLightingState ( GlfSimpleLightingContextPtr const lightingContext)
HDST_API void HdStSimpleLightingShader::SetLightingStateFromOpenGL ( )
HDST_API void HdStSimpleLightingShader::UnbindResources ( int  program,
HdSt_ResourceBinder const binder,
HdRenderPassState const state 

Unbinds shader-specific resources.

Implements HdStShaderCode.

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