VTK  9.3.1
vtkPBRPrefilterTexture.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkPBRPrefilterTexture_h
17 #define vtkPBRPrefilterTexture_h
18 
19 #include "vtkOpenGLTexture.h"
20 #include "vtkRenderingOpenGL2Module.h" // For export macro
21 
22 VTK_ABI_NAMESPACE_BEGIN
25 class vtkOpenGLTexture;
26 class vtkRenderWindow;
27 
28 class VTKRENDERINGOPENGL2_EXPORT vtkPBRPrefilterTexture : public vtkOpenGLTexture
29 {
30 public:
31  static vtkPBRPrefilterTexture* New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
39  void SetInputTexture(vtkOpenGLTexture*);
40  vtkGetObjectMacro(InputTexture, vtkOpenGLTexture);
42 
46  void Load(vtkRenderer*) override;
47 
51  void Render(vtkRenderer* ren) override { this->Load(ren); }
52 
54 
57  vtkGetMacro(PrefilterSize, unsigned int);
59 
61 
65  vtkGetMacro(PrefilterLevels, unsigned int);
66  vtkSetMacro(PrefilterLevels, unsigned int);
68 
70 
76  vtkGetMacro(PrefilterMaxSamples, unsigned int);
77  vtkSetMacro(PrefilterMaxSamples, unsigned int);
79 
81 
86  vtkGetMacro(ConvertToLinear, bool);
87  vtkSetMacro(ConvertToLinear, bool);
88  vtkBooleanMacro(ConvertToLinear, bool);
90 
92 
98  vtkGetMacro(HalfPrecision, bool);
99  vtkSetMacro(HalfPrecision, bool);
100  vtkBooleanMacro(HalfPrecision, bool);
102 
109  void ReleaseGraphicsResources(vtkWindow*) override;
110 
111 protected:
112  vtkPBRPrefilterTexture() = default;
113  ~vtkPBRPrefilterTexture() override;
114 
115  unsigned int PrefilterSize;
116  unsigned int PrefilterLevels = 5;
117  unsigned int PrefilterMaxSamples = 512;
118  vtkOpenGLTexture* InputTexture = nullptr;
119  bool ConvertToLinear = false;
120  bool HalfPrecision = true;
121 
122 private:
124  void operator=(const vtkPBRPrefilterTexture&) = delete;
125 };
126 
127 VTK_ABI_NAMESPACE_END
128 #endif
OpenGL rendering window.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for renderers
Definition: vtkRenderer.h:61
void Load(vtkRenderer *) override
Implement base class method.
OpenGL texture map.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
void Render(vtkRenderer *ren) override
Implement base class method.
a simple class to control print indentation
Definition: vtkIndent.h:28
precompute prefilter texture used in physically based rendering
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this texture.
Internal class which encapsulates OpenGL FramebufferObject.
create a window for renderers to draw into
static vtkOpenGLTexture * New()