Loading...
Searching...
No Matches
domeLightComputations.h
1//
2// Copyright 2019 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_DOME_LIGHT_COMPUTATIONS_H
8#define PXR_IMAGING_HD_ST_DOME_LIGHT_COMPUTATIONS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/computation.h"
13
14#include "pxr/base/tf/token.h"
15
16PXR_NAMESPACE_OPEN_SCOPE
17
21using HdSt_DomeLightComputationGPUSharedPtr =
22 std::shared_ptr<class HdSt_DomeLightComputationGPU>;
23using HdStSimpleLightingShaderPtr =
24 std::weak_ptr<class HdStSimpleLightingShader>;
25
38class HdSt_DomeLightComputationGPU : public HdStComputation
39{
40public:
42 HDST_API
43 HdSt_DomeLightComputationGPU(
44 // Name of computation shader to use, also used as
45 // key when setting the GL name on the lighting shader
46 const TfToken & shaderToken,
47 // Lighting shader that remembers the GL texture names
48 HdStSimpleLightingShaderPtr const &lightingShader,
49 // Number of mip levels.
50 unsigned int numLevels = 1,
51 // Level to be filled (0 means also to allocate texture)
52 unsigned int level = 0,
53 float roughness = -1.0);
54
55 HDST_API
56 void GetBufferSpecs(HdBufferSpecVector *specs) const override {}
57
58 HDST_API
59 void Execute(HdBufferArrayRangeSharedPtr const &range,
60 HdResourceRegistry *resourceRegistry) override;
61
65 int GetNumOutputElements() const override { return 0; }
66
67private:
68 const TfToken _shaderToken;
69 HdStSimpleLightingShaderPtr const _lightingShader;
70 const unsigned int _numLevels;
71 const unsigned int _level;
72 const float _roughness;
73};
74
75
76PXR_NAMESPACE_CLOSE_SCOPE
77
78#endif // PXR_IMAGING_HD_ST_DOME_LIGHT_COMPUTATIONS_H
A central registry for resources.
An interface class for GPU computation.
Definition: computation.h:36
virtual void Execute(HdBufferArrayRangeSharedPtr const &range, HdResourceRegistry *resourceRegistry)=0
Execute computation.
virtual void GetBufferSpecs(HdBufferSpecVector *specs) const =0
Add the buffer spec for this computation into given bufferspec vector.
virtual int GetNumOutputElements() const =0
Returns the size of its destination buffer (located by range argument of Execute()).
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...