Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualRadikalizm

Posted 08 August 2012 - 01:56 AM


Post-processing is mostly done by rendering to another render target texture, you don't write it back into the G-Buffer since the G-Buffer is solely meant for storing actual data about your geometry and because it could be required for other post-processing steps.

I'm unsure I understood you correctly, please tell me if I'm wrong.
So I have to keep Color, Depth and Normal Buffers unmodified at all times, perform phong shading and output result into extra RT #1, then perform antialiasing and output into extra RT #2, and then copy from extra RT #2 to backbuffer? Isn't it a bit memory waste keeping one extra RT for each pass?


That's basically how I do this yes, and I assume that's how it's done in most of the cases. You could avoid wasting memory by re-using RTTs when possible, but this becomes more difficult when you need more 'exotic' texture formats for specific purposes or differently sized render targets, which you will definitely need once you get to more advanced effects. Another problem with re-using RTTs could arise when you have to run different branches of post-processing effects which need to be combined together as you have to make sure that the contents of certain RTTs don't get invalidated.

Experiment with it a bit and see what works out for you
It comes down to doing a good amount of profiling I suppose

#1Radikalizm

Posted 08 August 2012 - 01:45 AM


Post-processing is mostly done by rendering to another render target texture, you don't write it back into the G-Buffer since the G-Buffer is solely meant for storing actual data about your geometry and because it could be required for other post-processing steps.

I'm unsure I understood you correctly, please tell me if I'm wrong.
So I have to keep Color, Depth and Normal Buffers unmodified at all times, perform phong shading and output result into extra RT #1, then perform antialiasing and output into extra RT #2, and then copy from extra RT #2 to backbuffer? Isn't it a bit memory waste keeping one extra RT for each pass?


That's basically how I do this yes, and I assume that's how it's done in most of the cases. You could avoid wasting memory by re-using RTTs when possible, but this becomes more difficult when you need more 'exotic' texture formats for specific purposes, which you will definitely need once you get to more advanced effects. Another problem with re-using RTTs could arise when you have to run different branches of post-processing effects which need to be combined together as you have to make sure that the contents of certain RTTs don't get invalidated.

Experiment with it a bit and see what works out for you
It comes down to doing a good amount of profiling I suppose

PARTNERS