VTK  9.1.0
vtkOpenGLRenderer.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenGLRenderer.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
32#ifndef vtkOpenGLRenderer_h
33#define vtkOpenGLRenderer_h
34
35#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_0_0
36#include "vtkRenderer.h"
37#include "vtkRenderingOpenGL2Module.h" // For export macro
38#include "vtkSmartPointer.h" // For vtkSmartPointer
39#include <string> // Ivars
40#include <vector> // STL Header
41
42class vtkFloatArray;
44class vtkRenderPass;
45class vtkOpenGLState;
55class vtkSSAOPass;
56
57class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderer : public vtkRenderer
58{
59public:
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
67 void DeviceRender(void) override;
68
73
81
82 void Clear(void) override;
83
87 int UpdateLights(void) override;
88
96
104 "Removed in 9.1.0 as this bug does not affect any macOS release that VTK supports")
105 bool HaveApplePrimitiveIdBug();
106
111 static bool HaveAppleQueryAllocationBug();
112
118 bool IsDualDepthPeelingSupported();
119
120 // Get the state object used to keep track of
121 // OpenGL state
122 vtkOpenGLState* GetState();
123
124 // get the standard lighting uniform declarations
125 // for the current set of lights
126 const char* GetLightingUniforms();
127
128 // update the lighting uniforms for this shader if they
129 // are out of date
130 void UpdateLightingUniforms(vtkShaderProgram* prog);
131
132 // get the complexity of the current lights as a int
133 // 0 = no lighting
134 // 1 = headlight
135 // 2 = directional lights
136 // 3 = positional lights
138 {
139 NoLighting = 0,
140 Headlight = 1,
141 Directional = 2,
142 Positional = 3
143 };
144 vtkGetMacro(LightingComplexity, int);
145
146 // get the number of lights turned on
147 vtkGetMacro(LightingCount, int);
148
150
157
159
166
171
173
176 vtkSetMacro(UseSphericalHarmonics, bool);
177 vtkGetMacro(UseSphericalHarmonics, bool);
178 vtkBooleanMacro(UseSphericalHarmonics, bool);
180
184 void SetEnvironmentTexture(vtkTexture* texture, bool isSRGB = false) override;
185
186 // Method to release graphics resources
188
189protected:
192
196 void CheckCompilation(unsigned int fragmentShader);
197
203 int UpdateGeometry(vtkFrameBufferObjectBase* fbo = nullptr) override;
204
211
212 friend class vtkOpenGLProperty;
213 friend class vtkOpenGLTexture;
215 friend class vtkOpenGLImageResliceMapper;
216
221
226
231
236
241
242 // Is rendering at translucent geometry stage using depth peeling and
243 // rendering a layer other than the first one? (Boolean value)
244 // If so, the uniform variables UseTexture and Texture can be set.
245 // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
247
248 friend class vtkRenderPass;
249
254
259
265
266private:
267 vtkOpenGLRenderer(const vtkOpenGLRenderer&) = delete;
268 void operator=(const vtkOpenGLRenderer&) = delete;
269};
270
271#endif
Implement Depth Peeling for use within a framebuffer pass.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
abstract interface to OpenGL FBOs
a simple class to control print indentation
Definition: vtkIndent.h:43
Perform FXAA antialiasing on the current framebuffer.
OpenGL mapper for image slice display.
OpenGL property.
OpenGL renderer.
vtkPBRPrefilterTexture * GetEnvMapPrefiltered()
Get environment textures used for image based lighting.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPBRPrefilterTexture * EnvMapPrefiltered
void SetEnvironmentTexture(vtkTexture *texture, bool isSRGB=false) override
Overriden in order to connect the texture to the environment map textures.
vtkSmartPointer< vtkFloatArray > SphericalHarmonics
vtkPBRLUTTexture * GetEnvMapLookupTable()
Get environment textures used for image based lighting.
vtkShadowMapPass * ShadowMapPass
Shadows are delegated to an instance of vtkShadowMapPass.
vtkPBRIrradianceTexture * EnvMapIrradiance
std::string LightingDeclaration
vtkDepthPeelingPass * DepthPeelingPass
Depth peeling is delegated to an instance of vtkDepthPeelingPass.
vtkPBRLUTTexture * EnvMapLookupTable
vtkSSAOPass * SSAOPass
SSAO is delegated to an instance of vtkSSAOPass.
void Clear(void) override
Clear the image to the background color.
vtkSmartPointer< vtkTransform > UserLightTransform
Optional user transform for lights.
vtkTransform * GetUserLightTransform()
Set the user light transform applied after the camera transform.
void DeviceRenderTranslucentPolygonalGeometry(vtkFrameBufferObjectBase *fbo=nullptr) override
Render translucent polygonal geometry.
vtkTexture * GetCurrentTexturedBackground()
Check and return the textured background for the current state If monocular or stereo left eye,...
vtkOrderIndependentTranslucentPass * TranslucentPass
Fallback for transparency.
vtkMTimeType LightingUpdateTime
int UpdateLights(void) override
Ask lights to load themselves into graphics pipeline.
void DeviceRenderOpaqueGeometry(vtkFrameBufferObjectBase *fbo=nullptr) override
Overridden to support hidden line removal.
static vtkOpenGLRenderer * New()
vtkOpenGLFXAAFilter * FXAAFilter
FXAA is delegated to an instance of vtkOpenGLFXAAFilter.
void ReleaseGraphicsResources(vtkWindow *w) override
vtkPBRIrradianceTexture * GetEnvMapIrradiance()
Get environment textures used for image based lighting.
int UpdateGeometry(vtkFrameBufferObjectBase *fbo=nullptr) override
Ask all props to update and draw any opaque and translucent geometry.
void SetUserLightTransform(vtkTransform *transform)
Set the user light transform applied after the camera transform.
void DeviceRender(void) override
Concrete open gl render method.
vtkFloatArray * GetSphericalHarmonics()
Get spherical harmonics coefficients used for irradiance.
~vtkOpenGLRenderer() override
void CheckCompilation(unsigned int fragmentShader)
Check the compilation status of some fragment shader source.
int GetDepthPeelingHigherLayer()
Is rendering at translucent geometry stage using depth peeling and rendering a layer other than the f...
OpenGL state storage.
OpenGL texture map.
Implement OIT rendering using average color.
precompute irradiance texture used in physically based rendering
precompute BRDF look-up table texture used in physically based rendering
precompute prefilter texture used in physically based rendering
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:57
abstract specification for renderers
Definition: vtkRenderer.h:73
Implement a screen-space ambient occlusion pass.
Definition: vtkSSAOPass.h:43
The ShaderProgram uses one or more Shader objects.
Implement a shadow mapping render pass.
abstracts an OpenGL texture object.
handles properties associated with a texture map
Definition: vtkTexture.h:75
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
@ string
Definition: vtkX3D.h:496
#define VTK_DEPRECATED_IN_9_1_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287