Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CPostProcessorRP Class Reference

The object class supports post-processing such as Glow effects, Antialiasing using FXAA, and Exposure, Reflection... More...

#include <RenderPipeline/CPostProcessorRP.h>

Inheritance diagram for Skylicht::CPostProcessorRP:
Skylicht::CBaseRP Skylicht::IPostProcessor Skylicht::IRenderPipeline

Public Member Functions

virtual void initRender (int w, int h)
virtual void resize (int w, int h)
virtual void render (ITexture *target, CCamera *camera, CEntityManager *entityManager, const core::recti &vp, int cubeFaceId=-1, IRenderPipeline *lastRP=NULL)
virtual void postProcessing (ITexture *finalTarget, ITexture *color, ITexture *emission, ITexture *normal, ITexture *position, const core::recti &viewport, int cubeFaceId=-1)
void luminanceMapGeneration (ITexture *color)
void brightFilter (ITexture *from, ITexture *to, ITexture *emission)
void blurDown (int from, int to)
void blurUp (int from, int to)
void enableAutoExposure (bool b)
bool isEnableAutoExposure ()
void setManualExposure (float f)
float getManualExposure ()
void enableBloomEffect (bool b)
bool isEnableBloomEffect ()
void enableFXAA (bool b)
bool isEnableFXAA ()
void enableScreenSpaceReflection (bool b)
virtual bool isEnableScreenSpaceReflection ()
void enableLastFrameTexture (bool b)
bool isEnableLastFrameTexture ()
void setBloomThreshold (float f)
void setBloomIntensity (float f)
float getBloomThreshold ()
float getBloomIntensity ()
virtual ITexturegetLastFrameBuffer ()
Public Member Functions inherited from Skylicht::CBaseRP
virtual bool canRenderMaterial (CMaterial *m)
virtual bool canRenderShader (CShader *s)
virtual void setCamera (CCamera *camera)
virtual void setNextPipeLine (IRenderPipeline *next)
virtual void onNext (ITexture *target, CCamera *camera, CEntityManager *entity, const core::recti &vp, int cubeFaceId)
virtual void drawMeshBuffer (CMesh *mesh, int bufferID, CEntityManager *entity, int entityID, bool skinnedMesh)
virtual void drawInstancingMeshBuffer (CMesh *mesh, int bufferID, CShader *instancingShader, CEntityManager *entityMgr, int entityID, bool skinnedMesh)
virtual void updateTextureResource (CMesh *mesh, int bufferID, CEntityManager *entity, int entityID, bool skinnedMesh)
virtual void updateShaderResource (CShader *shader, CEntityManager *entity, int entityID, video::SMaterial &irrMaterial)
void beginRender2D (float w, float h)
void renderBufferToTarget (float sx, float sy, float sw, float sh, SMaterial &material, bool flipY=true, bool flipX=false)
void renderBufferToTarget (float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh, SMaterial &material, bool flipY=true, bool flipX=false)
void renderEnvironment (CCamera *camera, CEntityManager *entityMgr, const core::vector3df &position, ITexture *texture[], int *face, int numFace, bool allPipeline)
void renderCubeEnvironment (CCamera *camera, CEntityManager *entityMgr, const core::vector3df &position, ITexture *texture, int *face, int numFace, bool allPipeline)
void unbindRTT ()
Public Member Functions inherited from Skylicht::IRenderPipeline
virtual ERenderPipelineType getType ()
virtual void render (ITexture *target, CCamera *camera, CEntityManager *entity, const core::recti &viewport, int cubeFaceId=-1, IRenderPipeline *lastRP=NULL)=0
virtual void onNext (ITexture *target, CCamera *camera, CEntityManager *entity, const core::recti &viewport, int cubeFaceId)=0

Protected Member Functions

void initMainRTT (int w, int h)
void releaseMainRTT ()
void renderEffect (int fromTarget, int toTarget, CMaterial *material)
void renderEffect (ITexture *fromTarget, ITexture *toTarget, CMaterial *material)
Protected Member Functions inherited from Skylicht::CBaseRP
void disableTextureBilinear (SMaterial &m, int slot)
void enableTextureBilinear (SMaterial &m, int slot)
void setTarget (ITexture *target, int faceId)
void drawSceneToTexture (ITexture *target, CCamera *camera, CEntityManager *entityMgr, bool allPipeline)
void drawSceneToCubeTexture (ITexture *target, CCamera *camera, video::E_CUBEMAP_FACE faceID, CEntityManager *entityMgr, bool allPipeline)

Protected Attributes

core::dimension2du m_size
core::dimension2du m_lumSize
ITexturem_luminance [2]
ITexturem_adaptLum
int m_lumTarget
ITexturem_lastFrameBuffer
ITexturem_rtt [10]
SMaterial m_finalPass
SMaterial m_finalManualExposurePass
SMaterial m_linearPass
SMaterial m_lumPass
SMaterial m_adaptLumPass
SMaterial m_effectPass
float m_bloomThreshold
float m_bloomIntensity
float m_exposure
bool m_autoExposure
bool m_bloomEffect
bool m_fxaa
bool m_screenSpaceReflection
bool m_enableLastFrameTexture
CMaterialm_brightFilter
CMaterialm_blurDownFilter
CMaterialm_blurUpFilter
CMaterialm_bloomFilter
CMaterialm_fxaaFilter
Protected Attributes inherited from Skylicht::CBaseRP
IRenderPipeline * m_next
CMeshBuffer< video::S3DVertex2TCoords > * m_drawBuffer
IVertexBufferm_verticesImage
IIndexBufferm_indicesImage
float m_viewport2DW
float m_viewport2DH
SMaterial m_unbindMaterial
int m_textureColorShaderID
Protected Attributes inherited from Skylicht::IRenderPipeline
ERenderPipelineType m_type

Additional Inherited Members

Public Types inherited from Skylicht::IRenderPipeline
enum  ERenderPipelineType { Forwarder , Deferred , ShadowMap , Mix }
Static Public Member Functions inherited from Skylicht::CBaseRP
static void saveFBOToFile (ITexture *texture, const char *output)
static void setBakeMode (bool b)
static void setBakeLightmapMode (bool b)
static void setBakeLightingMapBounce (u32 i)
static void setClearColor (const SColor &c)
static void setMaxLight (u32 maxLights)
Public Attributes inherited from Skylicht::IRenderPipeline
std::function< void(IRenderPipeline *)> OnFinish
Static Protected Attributes inherited from Skylicht::CBaseRP
static bool s_bakeMode
static bool s_bakeLMMode
static u32 s_bakeBounce
static u32 s_maxLight
static SColor s_clearColor

Detailed Description

The object class supports post-processing such as Glow effects, Antialiasing using FXAA, and Exposure, Reflection...

On a smartphone, you shouldn't use too many of these effects as they can cause the device to heat up quickly and reduce the frame rate (FPS). However, You can use a Bloom Effect for smartphones.

Use the setPostProcessor function to attach a post-processor to the render pipeline. If you're using Deferred Rendering, attach the post-processor to that pipeline.

// 1st
CShadowMapRP* shadowMapRendering = new CShadowMapRP();
CShadowMapRP* shadowMapRendering->initRender(w, h);
// 2rd
CForwardRP* forwardRP = new CForwardRP(false);
CForwardRP* forwardRP->enableUpdateEntity(false);
// link rp
shadowMapRendering->setNextPipeLine(forwardRP);
if (postEffect == true)
{
// post processor
CPostProcessorRP* postProcessor = new CPostProcessorRP();
postProcessor->enableAutoExposure(false);
postProcessor->enableBloomEffect(true);
postProcessor->enableFXAA(false);
postProcessor->enableScreenSpaceReflection(false);
postProcessor->initRender(w, h);
// apply post processor
forwardRP->setPostProcessor(postProcessor);
}
forwardRP->initRender(w, h);
This object class will perform draw commands using "Forwarder rendering".
Definition CForwardRP.h:41
Shadow mapping pipeline for generating depth maps.
Definition CShadowMapRP.h:59

Member Function Documentation

◆ getLastFrameBuffer()

virtual ITexture * Skylicht::CPostProcessorRP::getLastFrameBuffer ( )
inlinevirtual

◆ initRender()

virtual void Skylicht::CPostProcessorRP::initRender ( int w,
int h )
virtual

◆ isEnableScreenSpaceReflection()

virtual bool Skylicht::CPostProcessorRP::isEnableScreenSpaceReflection ( )
inlinevirtual

◆ postProcessing()

virtual void Skylicht::CPostProcessorRP::postProcessing ( ITexture * finalTarget,
ITexture * color,
ITexture * emission,
ITexture * normal,
ITexture * position,
const core::recti & viewport,
int cubeFaceId = -1 )
virtual

◆ render()

virtual void Skylicht::CPostProcessorRP::render ( ITexture * target,
CCamera * camera,
CEntityManager * entityManager,
const core::recti & vp,
int cubeFaceId = -1,
IRenderPipeline * lastRP = NULL )
virtual

Implements Skylicht::CBaseRP.

◆ resize()

virtual void Skylicht::CPostProcessorRP::resize ( int w,
int h )
virtual

The documentation for this class was generated from the following file: