VTK  9.3.0
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 
18 #include <string> // For std::string
19 
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkAbstractMapper;
23 class vtkProp;
24 class vtkShaderProgram;
26 
27 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderPass : public vtkRenderPass
28 {
29 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
39  virtual bool PreReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
40  std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop);
41  virtual bool PostReplaceShaderValues(std::string& vertexShader, std::string& geometryShader,
42  std::string& fragmentShader, vtkAbstractMapper* mapper, vtkProp* prop);
44 
49  virtual bool SetShaderParameters(vtkShaderProgram* program, vtkAbstractMapper* mapper,
50  vtkProp* prop, vtkOpenGLVertexArrayObject* VAO = nullptr);
51 
60 
65 
69  vtkSetMacro(ActiveDrawBuffers, unsigned int);
70  vtkGetMacro(ActiveDrawBuffers, unsigned int);
71 
72 protected:
75 
79  void PreRender(const vtkRenderState* s);
80 
84  void PostRender(const vtkRenderState* s);
85 
86  unsigned int ActiveDrawBuffers = 0;
87 
88 private:
90  void operator=(const vtkOpenGLRenderPass&) = delete;
91 };
92 
93 VTK_ABI_NAMESPACE_END
94 #endif // vtkOpenGLRenderPass_h
abstract class specifies interface to map data
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for vtkObjectBase vector values.
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.
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.
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:49
Context in which a vtkRenderPass will render.
The ShaderProgram uses one or more Shader objects.
@ string
Definition: vtkX3D.h:490
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270