TDME2 1.9.121
DeferredLightingRenderShader.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
5#include <tdme/tdme.h>
10
11using std::array;
12
17
18/**
19 * Deferred lighint render shader
20 * @author Andreas Drewke
21 * @version $Id$
22 */
24{
25
26private:
27 Renderer* renderer { nullptr };
28 int32_t vertexShaderId { -1 };
29 int32_t fragmentShaderId { -1 };
30 int32_t programId { -1 };
40
41 // specular lighting
42 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightEnabled;
43 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightAmbient;
44 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightDiffuse;
45 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightSpecular;
46 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightPosition;
47 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightSpotDirection;
48 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightSpotExponent;
49 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightSpotCosCutoff;
50 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightConstantAttenuation;
51 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightLinearAttenuation;
52 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightQuadraticAttenuation;
53 array<int32_t, Engine::LIGHTS_MAX> uniformSpecularLightRadius;
54 int32_t uniformCameraMatrix { -1 };
55
56 // pbr
57 int32_t uniformCamera { -1 };
60 int32_t uniformbrdfLUT { -1 };
63 int32_t texturebrdfLUT { -1 };
64
65 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightEnabled;
66 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightAmbient;
67 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightDirection;
68 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightRange;
69 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightColor;
70 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightIntensity;
71 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightPosition;
72 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightInnerConeCos;
73 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightOuterConeCos;
74 array<int32_t, Engine::LIGHTS_MAX> uniformPBRLightType;
75
76
79
80public:
81 /**
82 * Public constructor
83 * @param renderer renderer
84 */
86
87 /**
88 * Public destructor
89 */
91
92 /**
93 * @return if initialized and ready to use
94 */
95 bool isInitialized();
96
97 /**
98 * Initialize
99 */
100 void initialize();
101
102 /**
103 * Use render program
104 * @param engine engine
105 */
106 void useProgram(Engine* engine);
107
108 /**
109 * Un use render program
110 */
111 void unUseProgram();
112
113};
Engine main class.
Definition: Engine.h:122