TDME2  1.9.200
PostProcessingProgram.cpp
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 
4 using std::string;
5 using std::vector;
6 
7 #include <tdme/tdme.h>
10 #include <tdme/engine/Engine.h>
11 
14 
15 
16 PostProcessingProgram::PostProcessingProgram(RenderPass renderPass) {
17  this->renderPass = renderPass;
18 }
19 
21  int effectPassIdx,
22  int frameBufferWidthDivideFactor,
23  int frameBufferHeightDivideFactor,
24  string shaderPrefix,
25  bool applyShadowMapping,
26  bool applyPostProcessing,
27  int32_t renderTypes,
28  Color4 clearColor,
29  bool renderLightSources,
30  bool skipOnLightSourceNotVisible
31 ) {
32  effectPasses.emplace_back(
33  effectPassIdx,
34  frameBufferWidthDivideFactor,
35  frameBufferHeightDivideFactor,
36  shaderPrefix,
37  applyShadowMapping,
38  applyPostProcessing,
39  renderTypes,
40  clearColor,
41  renderLightSources,
42  skipOnLightSourceNotVisible
43  );
44 }
45 
47  steps.emplace_back(
48  shaderId,
49  source,
50  target,
51  bindTemporary,
52  blendToSource
53  );
54 }
55 
57  for (auto step: steps) {
58  if (Engine::getInstance()->getPostProcessingShader()->hasShader(step.shaderId) == false) return false;
59  }
60  return true;
61 
62 }
Color 4 definition class.
Definition: Color4.h:18
static Engine * getInstance()
Returns engine instance.
Definition: Engine.h:612
void addEffectPass(int effectPassIdx, int frameBufferWidthDivideFactor, int frameBufferHeightDivideFactor, string shaderPrefix, bool applyShadowMapping, bool applyPostProcessing, int32_t renderTypes, Color4 clearColor, bool renderLightSources, bool skipOnLightSourceNotVisible)
Add effect pass.
void addPostProcessingStep(string shaderId, FrameBufferSource source, FrameBufferTarget target, bool bindTemporary=false, FrameBufferSource blendToSource=FRAMEBUFFERSOURCE_NONE)
Add step.