TDME2 1.9.121
LightingShaderLightScatteringDefaultImplementation.cpp
Go to the documentation of this file.
2
3#include <string>
4
5#include <tdme/tdme.h>
10
11using std::string;
12using std::to_string;
13
20
21bool LightingShaderLightScatteringDefaultImplementation::isSupported(Renderer* renderer) {
22 return renderer->getShaderVersion() == "gl3";
23}
24
26{
27}
28
30 return "ls_default";
31}
32
34{
35 auto shaderVersion = renderer->getShaderVersion();
36
37 // lighting
38 // fragment shader
41 "shader/" + shaderVersion + "/lighting/light_scattering",
42 "render_fragmentshader.frag",
43 "#define LIGHT_COUNT " + to_string(Engine::LIGHTS_MAX) + "\n"
44 );
45 if (fragmentShaderId == 0) return;
46
47 // vertex shader
50 "shader/" + shaderVersion + "/lighting/light_scattering",
51 "render_vertexshader.vert",
52 "#define LIGHT_COUNT " + to_string(Engine::LIGHTS_MAX) + "\n"
53 );
54 if (vertexShaderId == 0) return;
55
56 // create, attach and link program
60
61 //
63}
64
66}
67
69}
Engine main class.
Definition: Engine.h:122
static constexpr int LIGHTS_MAX
Definition: Engine.h:173
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:14