Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Combining multiple PostEffects


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 lipsryme   Members   -  Reputation: 1031

Like
0Likes
Like

Posted 03 August 2012 - 04:42 AM

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, 03 August 2012 - 04:44 AM.


Sponsor:

#2 bwhiting   Members   -  Reputation: 785

Like
4Likes
Like

Posted 03 August 2012 - 05:08 AM

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.

#3 Ashaman73   Crossbones+   -  Reputation: 7797

Like
2Likes
Like

Posted 03 August 2012 - 05:13 AM

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 ?

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]

#4 CC Ricers   Members   -  Reputation: 641

Like
0Likes
Like

Posted 03 August 2012 - 08:12 AM

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, 03 August 2012 - 08:12 AM.

My development blog: Electronic Meteor

#5 lipsryme   Members   -  Reputation: 1031

Like
0Likes
Like

Posted 03 August 2012 - 02:42 PM

Thanks for the insight :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS