TDME2  1.9.200
DeferredLightingShaderSolidImplementation.cpp
Go to the documentation of this file.
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
7 #include <tdme/engine/Engine.h>
10 
11 using std::string;
12 using std::to_string;
13 
20 
21 bool DeferredLightingShaderSolidImplementation::isSupported(Renderer* renderer) {
22  return renderer->isDeferredShadingAvailable() == true;
23 }
24 
26 {
27 }
28 
30  return "defer_solid";
31 }
32 
34 {
35  auto shaderVersion = renderer->getShaderVersion();
36 
37  // lighting
38  // fragment shader
41  "shader/" + shaderVersion + "/lighting/specular",
42  "defer_fragmentshader.frag",
43  "#define LIGHT_COUNT " + to_string(Engine::LIGHTS_MAX) + "\n#define HAVE_SOLID_SHADING"
44  );
45  if (fragmentShaderId == 0) return;
46 
47  // vertex shader
50  "shader/" + shaderVersion + "/lighting/specular",
51  "render_vertexshader.vert",
52  "#define LIGHT_COUNT " + to_string(Engine::LIGHTS_MAX) + "\n#define HAVE_SOLID_SHADING"
53  );
54  if (vertexShaderId == 0) return;
55 
56  // create, attach and link program
60 
61  //
63 }
64 
66 }
67 
68 
70 }
Engine main class.
Definition: Engine.h:131
virtual void updateShaderParameters(Renderer *renderer, int contextIdx) override
Update shader parameters.
virtual int32_t loadShader(int32_t type, const string &pathName, const string &fileName, const string &definitions=string(), const string &functions=string())=0
Loads a shader.
virtual int32_t createProgram(int type)=0
Creates a shader program.
virtual void attachShaderToProgram(int32_t programId, int32_t shaderId)=0
Attaches a shader to a program.
File system singleton class.
Definition: FileSystem.h:17