Sign in to follow this  
c_olin

Post-processing pipeline and render targets

Recommended Posts

I have implemented a simple deferred shading renderer. I have also implemented some post-processing effects (screen space water, depth of field) but they are all in one shader that takes the geometry buffer and renders the final image. I would like to set up a post-processing pipeline where a series of shaders modify the final image while having access to the geometry buffer as well as the current final image.

My question is this: When you write to a render target from a pixel shader (gl_FragData) is the render target modified instantly? In other words can each shader in the post-processing pipeline receive the current final image as input while writing to the final image? Or will I need to have two final image render targets and swap between them for each stage in the post-process? Like-so:

finalImage1 -> (WaterShader) -> finalImage2
finalImage2 -> (SSAO) -> finalImage1
finalImage1 -> (DepthOfField) -> finalImage2

Thanks

Share this post


Link to post
Share on other sites
[font=arial, verdana, tahoma, sans-serif][size=2]yes u have to swap between to rendertragets, it's not allowed to read and write from the same frame buffer.

only exception in OpenGL I know of is if u copy a rectangle of the framebuffer to an other rectangle with glBlitFramebuffer, but the two rectangles aren'T allowed to overlapp[/size][/font]

Share this post


Link to post
Share on other sites

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