VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22 
23 VTK_ABI_NAMESPACE_BEGIN
26 class vtkOpenGLTexture;
27 class vtkRenderWindow;
28 
29 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkPBRPrefilterTexture : public vtkOpenGLTexture
30 {
31 public:
32  static vtkPBRPrefilterTexture* New();
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37 
40  void SetInputTexture(vtkOpenGLTexture*);
41  vtkGetObjectMacro(InputTexture, vtkOpenGLTexture);
43 
47  void Load(vtkRenderer*) override;
48 
52  void Render(vtkRenderer* ren) override { this->Load(ren); }
53 
55 
58  vtkGetMacro(PrefilterSize, unsigned int);
60 
62 
66  vtkGetMacro(PrefilterLevels, unsigned int);
67  vtkSetMacro(PrefilterLevels, unsigned int);
69 
71 
77  vtkGetMacro(PrefilterMaxSamples, unsigned int);
78  vtkSetMacro(PrefilterMaxSamples, unsigned int);
80 
82 
87  vtkGetMacro(ConvertToLinear, bool);
88  vtkSetMacro(ConvertToLinear, bool);
89  vtkBooleanMacro(ConvertToLinear, bool);
91 
93 
99  vtkGetMacro(HalfPrecision, bool);
100  vtkSetMacro(HalfPrecision, bool);
101  vtkBooleanMacro(HalfPrecision, bool);
103 
110  void ReleaseGraphicsResources(vtkWindow*) override;
111 
112 protected:
113  vtkPBRPrefilterTexture() = default;
114  ~vtkPBRPrefilterTexture() override;
115 
116  unsigned int PrefilterSize;
117  unsigned int PrefilterLevels = 5;
118  unsigned int PrefilterMaxSamples = 512;
119  vtkOpenGLTexture* InputTexture = nullptr;
120  bool ConvertToLinear = false;
121  bool HalfPrecision = true;
122 
123 private:
125  void operator=(const vtkPBRPrefilterTexture&) = delete;
126 };
127 
128 VTK_ABI_NAMESPACE_END
129 #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:63
void Load(vtkRenderer *) override
Implement base class method.
OpenGL texture map.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
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
#define VTK_MARSHALAUTO
static vtkOpenGLTexture * New()