7#ifndef PXR_IMAGING_HDST_SIMPLE_LIGHTING_SHADER_H
8#define PXR_IMAGING_HDST_SIMPLE_LIGHTING_SHADER_H
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/binding.h"
13#include "pxr/imaging/hdSt/lightingShader.h"
15#include "pxr/imaging/hd/version.h"
23PXR_NAMESPACE_OPEN_SCOPE
28class HdStRenderBuffer;
30using HdStSimpleLightingShaderSharedPtr =
31 std::shared_ptr<class HdStSimpleLightingShader>;
32using HdRenderPassAovBindingVector = std::vector<HdRenderPassAovBinding>;
55 HdSt_ResourceBinder
const &binder)
override;
58 HdSt_ResourceBinder
const &binder)
override;
73 void AddBindings(HdStBindingRequestVector *customBindings)
override;
82 HdSt_MaterialParamVector
const&
GetParams()
const override;
90 GlfSimpleLightingContextRefPtr GetLightingContext()
const {
91 return _lightingContext;
106 const HdStTextureHandleSharedPtr &
108 return _domeLightEnvironmentTextureHandle;
125 const HdStTextureHandleSharedPtr &
128 HdRenderPassAovBindingVector
const& GetShadowAovBindings() {
129 return _shadowAovBindings;
133 void _AllocateShadowTextures(
136 void _CleanupAovBindings();
138 GlfSimpleLightingContextRefPtr _lightingContext;
140 std::unique_ptr<class HioGlslfx> _glslfx;
143 std::map<TfToken, HdStBindingRequest> _customBuffers;
149 HdStTextureHandleSharedPtr _domeLightEnvironmentTextureHandle;
152 NamedTextureHandleVector _namedTextureHandles;
154 NamedTextureHandleVector _domeLightTextureHandles;
155 NamedTextureHandle _shadowTextureHandle;
157 HdSt_MaterialParamVector _lightTextureParams;
161 HdRenderPassAovBindingVector _shadowAovBindings;
163 std::vector<HdStPooledRenderBufferUniquePtr> _shadowBuffers;
167PXR_NAMESPACE_CLOSE_SCOPE
Stores a 4x4 matrix of double elements.
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
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.
BindingRequest allows externally allocated buffers to be bound at render time.
A lighting shader base class.
A central registry of all GPU resources.
The context available in implementations of AddResourcesFromTextures.
A shader that supports simple lighting functionality.
HDST_API void RemoveBufferBinding(TfToken const &name)
Remove name from custom binding.
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 void AddBufferBinding(HdStBindingRequest const &req)
Add a custom binding request for use when this shader executes.
HDST_API void AddBindings(HdStBindingRequestVector *customBindings) override
Add custom bindings (used by codegen)
HDST_API void ClearBufferBindings()
Clear all custom bindings associated with this shader.
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 const HdStTextureHandleSharedPtr & GetDomeLightEnvironmentCubemapTextureHandle() const
The dome light environment cubemap texture generated from the latlong dome light texture.
HDST_API std::string GetSource(TfToken const &shaderStageKey) const override
Returns the shader source provided by this shader for shaderStageKey.
HDST_API ID ComputeHash() const override
HdShader overrides.
HDST_API void AddResourcesFromTextures(ResourceContext &ctx) const override
Adds computations to create the dome light textures that are pre-calculated from the environment map ...
HDST_API void UnbindResources(int program, HdSt_ResourceBinder const &binder) override
Unbinds shader-specific resources.
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 G...
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 ...
HDST_API void SetCamera(GfMatrix4d const &worldToViewMatrix, GfMatrix4d const &projectionMatrix) override
HdStLightingShader overrides.
HDST_API HdSt_MaterialParamVector const & GetParams() const override
HdStShaderCode overrides.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
A renderpass AOV represents a binding of some output of the rendering process to an output buffer.