VTK  9.2.6
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=========================================================================*/
22
23#ifndef vtkOpenGLRenderer_h
24#define vtkOpenGLRenderer_h
25
26#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_1_0
27#include "vtkRenderer.h"
28#include "vtkRenderingOpenGL2Module.h" // For export macro
29#include "vtkSmartPointer.h" // For vtkSmartPointer
30#include <string> // Ivars
31#include <vector> // STL Header
32
33class vtkFloatArray;
35class vtkRenderPass;
36class vtkOpenGLState;
46class vtkSSAOPass;
47
48class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderer : public vtkRenderer
49{
50public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
58 void DeviceRender(void) override;
59
64
72
73 void Clear(void) override;
74
78 int UpdateLights(void) override;
79
87
95 "Removed in 9.1.0 as this bug does not affect any macOS release that VTK supports")
97
103
110
111 // Get the state object used to keep track of
112 // OpenGL state
114
115 // get the standard lighting uniform declarations
116 // for the current set of lights
117 const char* GetLightingUniforms();
118
119 // update the lighting uniforms for this shader if they
120 // are out of date
122
123 // get the complexity of the current lights as a int
124 // 0 = no lighting
125 // 1 = headlight
126 // 2 = directional lights
127 // 3 = positional lights
135 vtkGetMacro(LightingComplexity, int);
136
137 // get the number of lights turned on
138 vtkGetMacro(LightingCount, int);
139
141
148
150
157
162
164
167 vtkSetMacro(UseSphericalHarmonics, bool);
168 vtkGetMacro(UseSphericalHarmonics, bool);
169 vtkBooleanMacro(UseSphericalHarmonics, bool);
171
175 void SetEnvironmentTexture(vtkTexture* texture, bool isSRGB = false) override;
176
177 // Method to release graphics resources
179
180protected:
183
187 void CheckCompilation(unsigned int fragmentShader);
188
194 int UpdateGeometry(vtkFrameBufferObjectBase* fbo = nullptr) override;
195
202
203 friend class vtkOpenGLProperty;
204 friend class vtkOpenGLTexture;
207
212
217
222
227
232
233 // Is rendering at translucent geometry stage using depth peeling and
234 // rendering a layer other than the first one? (Boolean value)
235 // If so, the uniform variables UseTexture and Texture can be set.
236 // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
238
239 friend class vtkRenderPass;
240
245
250
256
257private:
258 vtkOpenGLRenderer(const vtkOpenGLRenderer&) = delete;
259 void operator=(const vtkOpenGLRenderer&) = delete;
260};
261
262#endif
Implement Depth Peeling for use within a framebuffer pass.
dynamic, self-adjusting array of float
abstract interface to OpenGL FBOs
a simple class to control print indentation
Definition vtkIndent.h:34
Perform FXAA antialiasing on the current framebuffer.
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
Overridden 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.
vtkOpenGLState * GetState()
vtkPBRIrradianceTexture * EnvMapIrradiance
std::string LightingDeclaration
vtkDepthPeelingPass * DepthPeelingPass
Depth peeling is delegated to an instance of vtkDepthPeelingPass.
vtkPBRLUTTexture * EnvMapLookupTable
static bool HaveAppleQueryAllocationBug()
Indicate if this system is subject to the apple/NVIDIA bug that causes crashes in the driver when too...
friend class vtkOpenGLImageResliceMapper
vtkSSAOPass * SSAOPass
SSAO is delegated to an instance of vtkSSAOPass.
bool IsDualDepthPeelingSupported()
Dual depth peeling may be disabled for certain runtime configurations.
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.
friend class vtkRenderPass
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,...
const char * GetLightingUniforms()
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.
friend class vtkOpenGLImageSliceMapper
int UpdateGeometry(vtkFrameBufferObjectBase *fbo=nullptr) override
Ask all props to update and draw any opaque and translucent geometry.
void UpdateLightingUniforms(vtkShaderProgram *prog)
void SetUserLightTransform(vtkTransform *transform)
Set the user light transform applied after the camera transform.
void DeviceRender(void) override
Concrete open gl render method.
friend class vtkOpenGLTexture
bool HaveApplePrimitiveIdBug()
Indicate if this system is subject to the Apple/AMD bug of not having a working glPrimitiveId <rdar:/...
vtkFloatArray * GetSphericalHarmonics()
Get spherical harmonics coefficients used for irradiance.
~vtkOpenGLRenderer() override
friend class vtkOpenGLProperty
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.
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.
Hold a reference to a vtkObjectBase instance.
abstracts an OpenGL texture object.
handles properties associated with a texture map
Definition vtkTexture.h:66
describes linear transformations via a 4x4 matrix
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
#define VTK_DEPRECATED_IN_9_1_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287