VTK  9.4.20241103
vtkGLSLModLight.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
8#ifndef vtkGLSLModLight_h
9#define vtkGLSLModLight_h
10
11#include "vtkGLSLModifierBase.h"
12
13#include "vtkOpenGLRenderer.h" // for ivar
14#include "vtkRenderingOpenGL2Module.h" // for export macro
15#include "vtkWeakPointer.h" // for ivar
16
17VTK_ABI_NAMESPACE_BEGIN
18class vtkActor;
21
22class VTKRENDERINGOPENGL2_EXPORT vtkGLSLModLight : public vtkGLSLModifierBase
23{
24public:
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
30 {
31 int Complexity = 0;
32 int Count = 0;
33 };
34
36
37 vtkSetMacro(UsePBRTextures, bool);
38 vtkGetMacro(UsePBRTextures, bool);
39
40 vtkSetMacro(UseAnisotropy, bool);
41 vtkGetMacro(UseAnisotropy, bool);
42
43 vtkSetMacro(UseClearCoat, bool);
44 vtkGetMacro(UseClearCoat, bool);
45
46 // vtkGLSLModifierBase virtuals:
47 bool ReplaceShaderValues(vtkOpenGLRenderer* renderer, std::string& vertexShader,
48 std::string& tessControlShader, std::string& tessEvalShader, std::string& geometryShader,
49 std::string& fragmentShader, vtkAbstractMapper* mapper, vtkActor* actor) override;
51 vtkAbstractMapper* mapper, vtkActor* actor, vtkOpenGLVertexArrayObject* VAO = nullptr) override;
52 bool IsUpToDate(vtkOpenGLRenderer* renderer, vtkAbstractMapper* mapper, vtkActor* actor) override;
53
54protected:
56 ~vtkGLSLModLight() override;
57
59 int LastLightComplexity = 0;
60 int LastLightCount = 0;
61
63 bool UsePBRTextures = false;
64 bool UseAnisotropy = false;
65 bool UseClearCoat = false;
66
67private:
68 vtkGLSLModLight(const vtkGLSLModLight&) = delete;
69 void operator=(const vtkGLSLModLight&) = delete;
70};
71
72VTK_ABI_NAMESPACE_END
73#endif
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Implement light kit support in the OpenGL renderer for vtkCellGrid.
bool SetShaderParameters(vtkOpenGLRenderer *renderer, vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkActor *actor, vtkOpenGLVertexArrayObject *VAO=nullptr) override
bool ReplaceShaderValues(vtkOpenGLRenderer *renderer, std::string &vertexShader, std::string &tessControlShader, std::string &tessEvalShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkActor *actor) override
Abstract interfaces to replace shader values and apply parameters as uniform values.
bool IsUpToDate(vtkOpenGLRenderer *renderer, vtkAbstractMapper *mapper, vtkActor *actor) override
Whether mod needs to be re-applied.
static vtkGLSLModLight * New()
static LightStatsBasic GetBasicLightStats(vtkOpenGLRenderer *renderer, vtkActor *actor)
~vtkGLSLModLight() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Abstract class that helps you develop modifier for VTK GLSL shaders.
a simple class to control print indentation
Definition vtkIndent.h:108
Key for vtkObjectBase values.
OpenGL renderer.
The VertexArrayObject class uses, or emulates, vertex array objects.
The ShaderProgram uses one or more Shader objects.