TDME2 1.9.121
DeferredLightingShaderTerrainImplementation.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <tdme/tdme.h>
9
12
13/**
14 * Lighting shader implementation
15 * @author Andreas Drewke
16 * @version $Id$
17 */
19{
20public:
21 /**
22 * Public constructor
23 * @param renderer renderer
24 */
26
27 /**
28 * @return if supported by renderer
29 * @param renderer renderer
30 */
31 static bool isSupported(Renderer* renderer);
32
33 // overridden methods
34 virtual const string getId() override;
35 virtual void initialize() override;
36 virtual void registerShader() override;
37 virtual void useProgram(Engine* engine, int contextIdx) override;
38 virtual void unUseProgram(int contextIdx) override;
39 virtual void updateMatrices(Renderer* renderer, int contextIdx) override;
40 virtual void updateShaderParameters(Renderer* renderer, int contextIdx) override;
41
42private:
43 int32_t uniformModelMatrix { -1 };
44 int32_t uniformGrasTextureUnit { -1 };
45 int32_t uniformDirtTextureUnit { -1 };
46 int32_t uniformSnowTextureUnit { -1 };
48 int32_t grasTextureId { 0 };
49 int32_t dirtTextureId { 0 };
50 int32_t snowTextureId { 0 };
51 int32_t stoneTextureId { 0 };
52
53protected:
55
56};
Engine main class.
Definition: Engine.h:122
virtual void updateMatrices(Renderer *renderer, int contextIdx) override
Update matrices to program.
virtual void useProgram(Engine *engine, int contextIdx) override
Use lighting program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx) override
Update shader parameters.