The MPostProcessor class contains functionality used to render the current scene to a texture to allow applying GLSL post effects when rendering the final image to the screen.
More...
#include <PostProcessor.h>
The MPostProcessor class contains functionality used to render the current scene to a texture to allow applying GLSL post effects when rendering the final image to the screen.
Neo::PostProcessor::PostProcessor |
( |
| ) |
|
void Neo::PostProcessor::addFloatUniform |
( |
const char * |
name | ) |
|
Adds a uniform of the type float to the uniform list.
- Parameters
-
name | The name of the new uniform variable. |
void Neo::PostProcessor::addIntUniform |
( |
const char * |
name | ) |
|
Adds a uniform of the type int to the uniform list.
- Parameters
-
name | The name of the new uniform variable. |
void Neo::PostProcessor::clear |
( |
| ) |
|
Deletes all uniform variables currently registered.
bool Neo::PostProcessor::draw |
( |
OCamera * |
camera | ) |
|
Renders the current scene to a texture and then to the screen after applying the post effects shader.
- Parameters
-
- Returns
- Returns true if it rendered properly, false if it didn't.
void Neo::PostProcessor::drawQuad |
( |
Vector2 |
scale | ) |
|
|
protected |
void Neo::PostProcessor::eraseTextures |
( |
| ) |
|
Deletes the color and depth texture. That allows them to be recreated for example when the resolution changes.
float Neo::PostProcessor::getFloatUniformValue |
( |
int |
idx | ) |
|
Gets the float value of the uniform at the index.
- Parameters
-
idx | The index of the uniform. |
- Returns
- The float value
const char* Neo::PostProcessor::getFragmentShader |
( |
| ) |
|
|
inline |
- Returns
- The fragment shaders file path
int Neo::PostProcessor::getFX |
( |
| ) |
|
|
inline |
- Returns
- The internal FX ID.
int Neo::PostProcessor::getIntUniformValue |
( |
int |
idx | ) |
|
Gets the int value of the uniform at the index.
- Parameters
-
idx | The index of the uniform. |
- Returns
- The int value
int Neo::PostProcessor::getNumUniforms |
( |
| ) |
|
|
inline |
Returns the number of currently registered uniform variables. Increases whenever one of the "add*Uniform" gets called.
- Returns
- The number of all registered uniforms.
float Neo::PostProcessor::getResolutionMultiplier |
( |
| ) |
|
|
inline |
- Returns
- The resolution multiplier.
const char* Neo::PostProcessor::getUniformName |
( |
int |
idx | ) |
|
Returns the name of the specified uniform variable.
- Parameters
-
idx | The index of the uniform variable. |
- Returns
- The name of the uniform variable.
Returns the type of the specified uniform variable.
See also: M_VARIABLE_TYPE.
- Parameters
-
idx | The index of the uniform variable. |
- Returns
- The type of the uniform variable.
const char* Neo::PostProcessor::getVertexShader |
( |
| ) |
|
|
inline |
- Returns
- The vertex shaders file path
bool Neo::PostProcessor::loadShader |
( |
const char * |
vertShad, |
|
|
const char * |
fragShad |
|
) |
| |
Loads, compiles and links a shader pair to the GPU.
- Parameters
-
vertShad | The sources of the vertex shader. |
fragShad | The sources of the fragment shader. |
- Returns
- Returns true if both shader loaded properly, false if they didn't.
bool Neo::PostProcessor::loadShaderFile |
( |
const char * |
vertShad, |
|
|
const char * |
fragShad |
|
) |
| |
Loads, compiles and links a shader pair to the GPU.
- Parameters
-
vertShad | The path to the file containing the vertex shader sources. |
fragShad | The path to the file containing the fragment shader sources. |
- Returns
- Returns true if both shader loaded properly, false if they didn't.
void Neo::PostProcessor::sendUniforms |
( |
| ) |
|
|
protected |
void Neo::PostProcessor::set2D |
( |
unsigned int |
w, |
|
|
unsigned int |
h |
|
) |
| |
|
protected |
void Neo::PostProcessor::setFloatUniformValue |
( |
const char * |
name, |
|
|
float |
value |
|
) |
| |
Sets the value of a uniform with the type float.
- Parameters
-
name | The name of the uniform. This is the same name given when calling MPostProcessor::addFloatUniform(). |
value | The value to apply. |
void Neo::PostProcessor::setIntUniformValue |
( |
const char * |
name, |
|
|
float |
value |
|
) |
| |
Sets the value of a uniform with the type int.
- Parameters
-
name | The name of the uniform. This is the same name given when calling MPostProcessor::addIntUniform(). |
value | The value to apply. |
void Neo::PostProcessor::setResolutionMultiplier |
( |
float |
res | ) |
|
|
inline |
Sets the current resolution multiplier.
For this value to apply you need to call MPostProcessor::eraseTextures() and MPostProcessor::updateResolution().
This value is multiplied with the screen resolution, that means that value = 1.0 is the full resolution and value = 0.5 is the half of the full resolution etc.
- Parameters
-
res | The new resolution multiplier. |
void Neo::PostProcessor::setShaderPath |
( |
const char * |
vertPath, |
|
|
const char * |
fragPath |
|
) |
| |
Sets the path to the vertex shader and the fragment shader without loading them.
- Parameters
-
vertPath | The path to the vertex shader. |
fragPath | The path to the fragment shader. |
void Neo::PostProcessor::updateResolution |
( |
| ) |
|
Updates the color and depth texture to fit the current screen/window resolution. Needs to be called after MPostProcessor::eraseTextures()!
unsigned int Neo::PostProcessor::m_BufferID |
|
protected |
unsigned int Neo::PostProcessor::m_ColourTexID |
|
protected |
unsigned int Neo::PostProcessor::m_DepthTexID |
|
protected |
unsigned int Neo::PostProcessor::m_fragShad |
|
protected |
String Neo::PostProcessor::m_fragShadPath |
|
protected |
unsigned int Neo::PostProcessor::m_fx |
|
protected |
int Neo::PostProcessor::m_Resolution |
|
protected |
float Neo::PostProcessor::m_ResolutionMultiplier |
|
protected |
Vector2 Neo::PostProcessor::m_texCoords[4] |
|
protected |
vector<uintptr_t> Neo::PostProcessor::m_UniformList |
|
protected |
Vector2 Neo::PostProcessor::m_vertices[4] |
|
protected |
unsigned int Neo::PostProcessor::m_vertShad |
|
protected |
String Neo::PostProcessor::m_vertShadPath |
|
protected |
The documentation for this class was generated from the following file: