remember to change that first render call to a preRender() to make it safer.
Your effect is fairly efficient, although you could probably get away with PP_BLUR instead of bloom, i.e.
Code: Select all
CEffectPostProc* ppBloom = new CEffectPostProc( ppRenderer, dimension2di( 1024, 512 ),PP_BLUR,0.005f);
I made an example for depth of field. It uses PP_BLURDOF (maybe I should give it a better name?), and you need to remember to use special shaders on all your objects (shaders which set the alpha channel to the z-position * a constant). These can either be your own, or one of the basic ones I made;
setup code:
Code: Select all
u32 matid;
IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices( );
switch( driver->getDriverType( ) ) {
case EDT_OPENGL:
matid = gpu->addHighLevelShaderMaterial( GL_V_MAT, "main", EVST_VS_1_1, GL_PLAIN, "main", EPST_PS_1_1, new CTexturesShaderCallback( ), EMT_SOLID, 1 );
break;
case EDT_DIRECT3D8:
case EDT_DIRECT3D9:
default:
matid = gpu->addHighLevelShaderMaterial( DX_V_MAT, "main", EVST_VS_1_1, DX_PLAIN, "main", EPST_PS_1_1, NULL, EMT_SOLID, 0 );
}
Code: Select all
myNode->setMaterialType( (E_MATERIAL_TYPE) matid );