TDME2  1.9.200
ShadowMapRenderShaderImplementation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tdme/tdme.h>
4 #include <tdme/engine/fwd-tdme.h>
7 #include <tdme/math/Matrix4x4.h>
8 
12 
13 /**
14  * Shadow mapping shader interface to render shadow map
15  * @author Andreas Drewke
16  */
18 {
19  /**
20  * Destructor
21  */
23 
24  /**
25  * @return shader id
26  */
27  virtual const string getId() = 0;
28 
29  /**
30  * @return if initialized and ready to use
31  */
32  virtual bool isInitialized() = 0;
33 
34  /**
35  * Init shadow mapping
36  */
37  virtual void initialize() = 0;
38 
39  /**
40  * Use shadow map render shader program
41  * @param engine engine
42  * @param contextIdx context index
43  */
44  virtual void useProgram(Engine* engine, int contextIdx) = 0;
45 
46  /**
47  * Un use shadow map render shader program
48  * @param contextIdx context index
49  */
50  virtual void unUseProgram(int contextIdx) = 0;
51 
52  /**
53  * Update matrices
54  * @param contextIdx context index
55  */
56  virtual void updateMatrices(int contextIdx) = 0;
57 
58  /**
59  * Update texture matrix
60  * @param renderer renderer
61  * @param context contet
62  */
63  virtual void updateTextureMatrix(Renderer* renderer, int contextIdx) = 0;
64 
65  /**
66  * Update material
67  * @param renderer renderer
68  * @param context contet
69  */
70  virtual void updateMaterial(Renderer* renderer, int contextIdx) = 0;
71 
72  /**
73  * Update light
74  * @param renderer renderer
75  * @param context contet
76  * @param lightId light id
77  */
78  virtual void updateLight(Renderer* renderer, int contextIdx, int32_t lightId) = 0;
79 
80  /**
81  * Update shader parameters
82  * @param renderer renderer
83  * @param contextIdx context index
84  */
85  virtual void updateShaderParameters(Renderer* renderer, int contextIdx) = 0;
86 
87  /**
88  * Bind texture
89  * @param renderer renderer
90  * @param context contet
91  * @param textureId texture id
92  */
93  virtual void bindTexture(Renderer* renderer, int contextIdx, int32_t textureId) = 0;
94 
95  /**
96  * Set up program depth bias mvp matrix
97  * @param context contet
98  * @param depthBiasMVPMatrix depth bias mvp matrix
99  */
100  virtual void setDepthBiasMVPMatrix(int contextIdx, const Matrix4x4& depthBiasMVPMatrix) = 0;
101 
102  /**
103  * Set light id
104  * @param lightId light id to render
105  */
106  virtual void setRenderLightId(int32_t lightId) = 0;
107 
108  /**
109  * Unload textures
110  */
111  virtual void unloadTextures() = 0;
112 
113  /**
114  * Load textures
115  * @param pathName path name
116  */
117  virtual void loadTextures(const string& pathName) = 0;
118 
119 };
Engine main class.
Definition: Engine.h:131
Matrix4x4 class representing matrix4x4 mathematical structure and operations for 3d space.
Definition: Matrix4x4.h:23
virtual void setDepthBiasMVPMatrix(int contextIdx, const Matrix4x4 &depthBiasMVPMatrix)=0
Set up program depth bias mvp matrix.
virtual void loadTextures(const string &pathName)=0
Load textures.
virtual void updateTextureMatrix(Renderer *renderer, int contextIdx)=0
Update texture matrix.
virtual void unUseProgram(int contextIdx)=0
Un use shadow map render shader program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx)=0
Update shader parameters.
virtual void updateLight(Renderer *renderer, int contextIdx, int32_t lightId)=0
Update light.
virtual void bindTexture(Renderer *renderer, int contextIdx, int32_t textureId)=0
Bind texture.
virtual void useProgram(Engine *engine, int contextIdx)=0
Use shadow map render shader program.
virtual void updateMaterial(Renderer *renderer, int contextIdx)=0
Update material.