VTK  9.4.20241112
vtkOpenGLRenderPass.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
3
12#ifndef vtkOpenGLRenderPass_h
13#define vtkOpenGLRenderPass_h
14
15#include "vtkRenderPass.h"
16#include "vtkRenderingOpenGL2Module.h" // For export macro
17#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
18
19#include <string> // For std::string
20
21VTK_ABI_NAMESPACE_BEGIN
24class vtkProp;
27
28class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLRenderPass : public vtkRenderPass
29{
30public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
35
40 virtual bool PreReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
41 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop);
42 virtual bool PostReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
43 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop);
45
51 vtkProp* prop, vtkOpenGLVertexArrayObject* VAO = nullptr);
52
61
66
70 vtkSetMacro(ActiveDrawBuffers, unsigned int);
71 vtkGetMacro(ActiveDrawBuffers, unsigned int);
72
73protected:
76
80 void PreRender(const vtkRenderState* s);
81
86 virtual void PreRenderProp(vtkProp* prop);
87
91 void PostRender(const vtkRenderState* s);
92
97 virtual void PostRenderProp(vtkProp* prop);
98
99 unsigned int ActiveDrawBuffers = 0;
100
101private:
103 void operator=(const vtkOpenGLRenderPass&) = delete;
104};
105
106VTK_ABI_NAMESPACE_END
107#endif // vtkOpenGLRenderPass_h
abstract class specifies interface to map data
a simple class to control print indentation
Definition vtkIndent.h:108
Abstract render pass with shader modifications.
virtual bool PostReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop)
Use vtkShaderProgram::Substitute to replace.
void PostRender(const vtkRenderState *s)
Call after rendering to clean up the actors' information keys.
void PreRender(const vtkRenderState *s)
Call before rendering to update the actors' information keys.
virtual bool SetShaderParameters(vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkProp *prop, vtkOpenGLVertexArrayObject *VAO=nullptr)
Update the uniforms of the shader program.
virtual bool PreReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop)
Use vtkShaderProgram::Substitute to replace.
virtual void PostRenderProp(vtkProp *prop)
Called in PreRender to give a chance to subclasses to clean up information keys.
static vtkInformationObjectBaseVectorKey * RenderPasses()
Key containing information about the current pass.
~vtkOpenGLRenderPass() override
virtual vtkMTimeType GetShaderStageMTime()
For multi-stage render passes that need to change shader code during a single pass,...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void PreRenderProp(vtkProp *prop)
Called in PreRender to give a chance to subclasses to set additonal information keys.
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
Perform part of the rendering of a vtkRenderer.
Context in which a vtkRenderPass will render.
The ShaderProgram uses one or more Shader objects.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_MARSHALAUTO