Irrlicht Post Processing Effects Chain
Posted: Mon Feb 12, 2007 9:26 am
I'm developing some new classes in Irrlicht sources that allow to implement multiple Post Processing effects with shaders supported by irrlicht (HLSL, assembly, etc..). The project is almost completed, at least for the "core" functions.
At the moment the following things has been implemented:
New classes added to Irrlicht source are IPostProcessing, CPostProcessing (the implementation of IPostProcessing abstract class). A new method as been added to IVideoDriver (createPostProcessingChain) that allow return an IPostProcessing pointer to the PostProcessing object created by the driver.
In the createPostProcessingChain you have to pass the shader filename, and pixel/vertex shader type (E_PIXEL_SHADER_TYPE and E_VERTEX_SHADER_TYPE). The created IPostProcessing implements the filter (or effect) in the shader file. Then you can add more effect by calling IPostProcessing::AddEffect, and passing the same kind of parameters plus the dimension of the result render target size, and an integer that specify the input effect to which the shader will work (0 rappresents the base scene, 1 the output of the first effect, and so on)
Each effect is a "pass" stage, this means that each effect, also explained before, takes in input the output of another effect (added before) or the base scene. The last effect renders directly to the frame buffer (and in this case the specified size of output render target is ignored).
The size of ouput render target is useful, for example, if u want to implement effects like Bloom filters.
With this things i think the most post processing things can be done. But if i can i consider to add more features to it.
In the next days i will upload these classes to be added to your Irrlicht sources, so you can tell me what can be adjusted or what can i add, or even some one can add more features to make this classes like, or bettere, the Ogre Compositor service.
If someone explain me if there is a better way to publicate the class sources on something like a CVS i will do it, istead of using code snippets.
Thanks!
At the moment the following things has been implemented:
New classes added to Irrlicht source are IPostProcessing, CPostProcessing (the implementation of IPostProcessing abstract class). A new method as been added to IVideoDriver (createPostProcessingChain) that allow return an IPostProcessing pointer to the PostProcessing object created by the driver.
In the createPostProcessingChain you have to pass the shader filename, and pixel/vertex shader type (E_PIXEL_SHADER_TYPE and E_VERTEX_SHADER_TYPE). The created IPostProcessing implements the filter (or effect) in the shader file. Then you can add more effect by calling IPostProcessing::AddEffect, and passing the same kind of parameters plus the dimension of the result render target size, and an integer that specify the input effect to which the shader will work (0 rappresents the base scene, 1 the output of the first effect, and so on)
Each effect is a "pass" stage, this means that each effect, also explained before, takes in input the output of another effect (added before) or the base scene. The last effect renders directly to the frame buffer (and in this case the specified size of output render target is ignored).
The size of ouput render target is useful, for example, if u want to implement effects like Bloom filters.
With this things i think the most post processing things can be done. But if i can i consider to add more features to it.
In the next days i will upload these classes to be added to your Irrlicht sources, so you can tell me what can be adjusted or what can i add, or even some one can add more features to make this classes like, or bettere, the Ogre Compositor service.
If someone explain me if there is a better way to publicate the class sources on something like a CVS i will do it, istead of using code snippets.
Thanks!