TDME2 1.9.121
ShadowMapRenderShaderBaseImplementation.h
Go to the documentation of this file.
1#pragma once
2
3#include <tdme/tdme.h>
10#include <tdme/math/Vector3.h>
11
17
18/**
19 * Shadow mapping base shader to render shadow maps
20 * @author Andreas Drewke
21 * @version $Id$
22 */
24{
25protected:
26 Renderer* renderer { nullptr };
27 int32_t vertexShaderId { -1 };
28 int32_t renderGeometryShaderId { -1 };
29 int32_t fragmentShaderId { -1 };
30 int32_t programId { -1 };
32 int32_t uniformTextureUnit { -1 };
38 int32_t renderUniformMVMatrix { -1 };
39 int32_t renderUniformMVPMatrix { -1 };
42 int32_t uniformTextureMatrix { -1 };
56 int32_t renderUniformTime { -1 };
58 int lightId { -1 };
59
60public:
61 /**
62 * Public constructor
63 * @param renderer renderer
64 */
66
67 /**
68 * Destructor
69 */
71
72 // overridden methods
73 virtual bool isInitialized() override;
74 virtual void initialize() override;
75 virtual void useProgram(Engine* engine, int contextIdx) override;
76 virtual void unUseProgram(int contextIdx) override;
77 virtual void updateMatrices(int contextIdx) override;
78 virtual void updateTextureMatrix(Renderer* renderer, int contextIdx) override;
79 virtual void updateMaterial(Renderer* renderer, int contextIdx) override;
80 virtual void updateLight(Renderer* renderer, int contextIdx, int32_t lightId) override;
81 virtual void updateShaderParameters(Renderer* renderer, int contextIdx) override = 0;
82 virtual void bindTexture(Renderer* renderer, int contextIdx, int32_t textureId) override;
83 virtual void setDepthBiasMVPMatrix(int contextIdx, const Matrix4x4& depthBiasMVPMatrix) override;
84 virtual void setRenderLightId(int32_t lightId) override;
85
86};
Engine main class.
Definition: Engine.h:122
virtual void updateLight(Renderer *renderer, int contextIdx, int32_t lightId) override
Update light.
virtual void updateTextureMatrix(Renderer *renderer, int contextIdx) override
Update texture matrix.
virtual void updateMaterial(Renderer *renderer, int contextIdx) override
Update material.
virtual void bindTexture(Renderer *renderer, int contextIdx, int32_t textureId) override
Bind texture.
virtual void unUseProgram(int contextIdx) override
Un use shadow map render shader program.
virtual void useProgram(Engine *engine, int contextIdx) override
Use shadow map render shader program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx) override=0
Update shader parameters.
virtual void setDepthBiasMVPMatrix(int contextIdx, const Matrix4x4 &depthBiasMVPMatrix) override
Set up program depth bias mvp matrix.
4x4 3D Matrix class
Definition: Matrix4x4.h:24
3D vector 3 class
Definition: Vector3.h:22