TDME2 1.9.121
PostProcessingShaderSSAOImplementation.cpp
Go to the documentation of this file.
1#include <string>
2
3#include <tdme/tdme.h>
8
9using std::string;
10
14
15bool PostProcessingShaderSSAOImplementation::isSupported(Renderer* renderer) {
16 return renderer->getShaderVersion() == "gl3";
17}
18
20{
21}
22
24{
25 auto shaderVersion = renderer->getShaderVersion();
26
27 // fragment shader
30 "shader/" + shaderVersion + "/postprocessing",
31 "ssao_fragmentshader.frag",
32 Engine::is4K() == true?"#define HAVE_4K":""
33 );
34 if (fragmentShaderId == 0) return;
35
36 // vertex shader
39 "shader/" + shaderVersion + "/postprocessing",
40 "ssao_vertexshader.vert"
41 );
42 if (vertexShaderId == 0) return;
43
44 // create, attach and link program
48
49 //
51
52 // register shader
53 if (initialized == true) Engine::registerShader(Engine::ShaderType::SHADERTYPE_POSTPROCESSING, "ssao");
54}
55
57}
Engine main class.
Definition: Engine.h:122
static void registerShader(ShaderType type, const string &shaderId, const map< string, ShaderParameter > &parameterDefaults={})
Register shader.
Definition: Engine.cpp:2122
static bool is4K()
Definition: Engine.h:594
virtual void setShaderParameters(int contextIdx, Engine *engine) override
Set 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.