Loading...
Searching...
No Matches
fallbackLightingShader.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_ST_FALLBACK_LIGHTING_SHADER_H
8#define PXR_IMAGING_HD_ST_FALLBACK_LIGHTING_SHADER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/lightingShader.h"
13
14#include <memory>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18class HioGlslfx;
19
24class HdSt_FallbackLightingShader : public HdStLightingShader
25{
26public:
27 HDST_API
28 HdSt_FallbackLightingShader();
29 HDST_API
30 ~HdSt_FallbackLightingShader() override;
31
32 // HdStShaderCode overrides
33 HDST_API
34 ID ComputeHash() const override;
35 HDST_API
36 std::string GetSource(TfToken const &shaderStageKey) const override;
37 HDST_API
38 void BindResources(int program,
39 HdSt_ResourceBinder const &binder) override;
40 HDST_API
41 void UnbindResources(int program,
42 HdSt_ResourceBinder const &binder) override;
43 HDST_API
44 void AddBindings(HdStBindingRequestVector *customBindings) override;
45
46 // HdStLightingShader overrides
47 HDST_API
48 void SetCamera(GfMatrix4d const &worldToViewMatrix,
49 GfMatrix4d const &projectionMatrix) override;
50
51private:
52 std::unique_ptr<HioGlslfx> _glslfx;
53};
54
55
56PXR_NAMESPACE_CLOSE_SCOPE
57
58#endif // PXR_IMAGING_HD_ST_FALLBACK_LIGHTING_SHADER_H
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
A lighting shader base class.
virtual void SetCamera(GfMatrix4d const &worldToViewMatrix, GfMatrix4d const &projectionMatrix)=0
Sets camera state.
virtual void BindResources(int program, HdSt_ResourceBinder const &binder)=0
Binds shader-specific resources to program XXX: this interface is meant to be used for bridging the G...
virtual void AddBindings(HdStBindingRequestVector *customBindings)=0
Add custom bindings (used by codegen)
virtual std::string GetSource(TfToken const &shaderStageKey) const =0
Returns the shader source provided by this shader for shaderStageKey.
virtual void UnbindResources(int program, HdSt_ResourceBinder const &binder)=0
Unbinds shader-specific resources.
virtual ID ComputeHash() const =0
Returns the hash value of the shader code and configuration.
A class representing the config and shader source of a glslfx file.
Definition: glslfx.h:134
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71