TDME2 1.9.121
ShadowMapCreationShaderBaseImplementation.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <tdme/tdme.h>
10
15
16/**
17 * Shadow mapping shader base class to create shadow map
18 * @author Andreas Drewke
19 * @version $Id$
20 */
22{
23protected:
24 Renderer* renderer { nullptr };
25 int32_t vertexShaderId { -1 };
26 int32_t geometryShaderId { -1 };
27 int32_t fragmentShaderId { -1 };
28 int32_t programId { -1 };
30 int32_t uniformCameraMatrix { -1 };
31 int32_t uniformMVPMatrix { -1 };
34 int32_t uniformTextureMatrix { -1 };
40 int32_t uniformTime { -1 };
41 bool initialized { false };
42
43public:
44 /**
45 * Constructor
46 * @param renderer renderer
47 */
49
50 /**
51 * Destructor
52 */
54
55 // overridden methods
56 virtual bool isInitialized() override;
57 virtual void initialize() override;
58 virtual void useProgram(Engine* engine, int contextIdx) override;
59 virtual void unUseProgram(int contextIdx) override;
60 virtual void updateMatrices(int contextIdx) override;
61 virtual void updateTextureMatrix(Renderer* renderer, int contextIdx) override;
62 virtual void updateMaterial(Renderer* renderer, int contextIdx) override;
63 virtual void updateShaderParameters(Renderer* renderer, int contextIdx) override = 0;
64 virtual void bindTexture(Renderer* renderer, int contextIdx, int32_t textureId) override;
65
66};
Engine main class.
Definition: Engine.h:122
virtual void updateTextureMatrix(Renderer *renderer, int contextIdx) override
Set up program 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
Unuse shadow map creation program.
virtual void useProgram(Engine *engine, int contextIdx) override
Use shadow map creation program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx) override=0
Update shader parameters.
4x4 3D Matrix class
Definition: Matrix4x4.h:24