Sign in to follow this  

Combining multiple PostEffects

This topic is 1962 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm curious on how the correct way of applying them should work.

Do I input my final rendered image (before postfx) into the first posteffect and then output to a seperate image which is then the input of the next postEffect (like a chain) ?

Or do I reuse the final rendered image for every postEffect and then render the result to seperate images which I then combine (multiply) by each other in a final shader ?

How is this normally done ?

I realize that it might not work applying e.g. a blur onto an already blurred image from the posteffect before, so I'd rather do something like the second approach? Or is that the same =/ ? Edited by lipsryme

Share this post


Link to post
Share on other sites
depends on what you are trying to do, if you want flexibility a chain isn't ideal but if you do one at a time you end up with duplicated work.

I went for more of a graph-esque enabling me to plug any output into any input, that way you can reuse effects such as downsamples blurs luminance etc but only if needed.

However if you want PURE speed and you know what you want your end result to be you will want to combine as many steps as possible to reduce the number of passes.

With a graph you could analyse the structure and then flatten effect where possible, a bit more work but should give you the best of both.

Just my 2 pennies and I am sure there are better ways, but that has worked well for me.

Share this post


Link to post
Share on other sites
[quote name='lipsryme' timestamp='1343990552' post='4965806']
Do I input my final rendered image (before postfx) into the first posteffect and then output to a seperate image which is then the input of the next postEffect (like a chain) ?

Or do I reuse the final rendered image for every postEffect and then render the result to seperate images which I then combine (multiply) by each other in a final shader ?

How is this normally done ?
[/quote]
It depends. Chains and composition of previous results are used both. It is more like a graph than a pure sequence, here's a simple example:
[source lang="cpp"]
geometry => lightning => apply shadow => apply bloom => apply SSAO => apply outlines
=> half resolution => blur =^
=> SSAO =^
[/source]

Share this post


Link to post
Share on other sites
I started out with an effect chain, then decided that I want to work with two outputs separately and then combine them.

For example for a Depth of Field effect I needed two copies of the full color output. One to keep it as-is, and the other to pass it through a blur filter. Then I interpolate the blurred image and the original, unblurred image for a simple soft-focus DOF effect.

I had to make a helper "CopyShader" class for needing multiple copies of the same render target, because I cannot deep copy a RenderTarget in a straightforward manner in the API I'm currently using (XNA). Edited by CC Ricers

Share this post


Link to post
Share on other sites

This topic is 1962 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this