TDME2  1.9.200
PostProcessingProgram.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <tdme/tdme.h>
7 #include <tdme/engine/Color4.h>
9 
10 using std::string;
11 using std::vector;
12 
14 
15 /**
16  * Post processing program
17  * @author Andreas Drewke
18  */
20 {
21  friend class PostProcessing;
22 
23 public:
27 
28 private:
31  int effectPassIdx,
34  const string& shaderPrefix,
35  bool applyShadowMapping,
37  int32_t renderTypes,
38  const Color4& clearColor,
39  bool renderLightSources,
41  ):
52  {}
56  string shaderPrefix;
59  int32_t renderTypes;
63  };
66  const string& shaderId,
69  bool bindTemporary,
71  ):
73  source(source),
74  target(target),
77  {}
78  string shaderId;
83  };
85  vector<PostProcessingProgramEffectPass> effectPasses;
86  vector<PostProcessingProgramStep> steps;
87 
88 public:
89  // forbid class copy
91 
92  /**
93  * Constructor
94  * @param renderPass render pass
95  */
97 
98  /**
99  * Add effect pass
100  * @param effectPassIdx effect pass index
101  * @param frameBufferWidthDivideFactor frame buffer width divide factor
102  * @param frameBufferHeightDivideFactor frame buffer height divide factor
103  * @param shaderPrefix shader prefix
104  * @param applyShadowMapping apply shadow mapping
105  * @param applyPostProcessing apply post processing
106  * @param renderTypes render types
107  * @param clearColor clear color
108  * @param renderLightSources render light sources
109  * @param skipOnLightSourceNotVisible skip on light source not visible
110  */
111  void addEffectPass(
112  int effectPassIdx,
113  int frameBufferWidthDivideFactor,
114  int frameBufferHeightDivideFactor,
115  string shaderPrefix,
116  bool applyShadowMapping,
117  bool applyPostProcessing,
118  int32_t renderTypes,
119  Color4 clearColor,
120  bool renderLightSources,
121  bool skipOnLightSourceNotVisible
122  );
123 
124  /**
125  * @return effect passes
126  */
127  inline const vector<PostProcessingProgramEffectPass>& getEffectPasses() const {
128  return effectPasses;
129  }
130 
131  /**
132  * Add step
133  * @param shaderId shader Id
134  * @param source source
135  * @param target target
136  * @param bindTemporary bind temporary
137  * @param blendToSource blend to source
138  */
140  string shaderId,
141  FrameBufferSource source,
142  FrameBufferTarget target,
143  bool bindTemporary = false,
145  );
146 
147  /**
148  * @return render pass
149  */
150  inline const RenderPass getRenderPass() const {
151  return renderPass;
152  }
153 
154  /**
155  * @return steps
156  */
157  inline const vector<PostProcessingProgramStep>& getPostProcessingSteps() const {
158  return steps;
159  }
160 
161  /**
162  * Checks if program is supported
163  * @return if program is supported
164  */
165  bool isSupported();
166 
167 };
Color 4 definition class.
Definition: Color4.h:18
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.
const vector< PostProcessingProgramStep > & getPostProcessingSteps() const
const vector< PostProcessingProgramEffectPass > & getEffectPasses() const
void addPostProcessingStep(string shaderId, FrameBufferSource source, FrameBufferTarget target, bool bindTemporary=false, FrameBufferSource blendToSource=FRAMEBUFFERSOURCE_NONE)
Add step.
PostProcessingProgramEffectPass(int effectPassIdx, int frameBufferWidthDivideFactor, int frameBufferHeightDivideFactor, const string &shaderPrefix, bool applyShadowMapping, bool applyPostProcessing, int32_t renderTypes, const Color4 &clearColor, bool renderLightSources, bool skipOnLightSourceNotVisible)
PostProcessingProgramStep(const string &shaderId, FrameBufferSource source, FrameBufferTarget target, bool bindTemporary, FrameBufferSource blendToSource)
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6