Jump to content
  • Advertisement
Sign in to follow this  
c_olin

Post-processing pipeline and render targets

This topic is 2589 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 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
Advertisement
[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[/font]

Share this post


Link to post
Share on other sites
http://www.opengl.org/wiki/GLSL_:_common_mistakes#Sampling_and_Rendering_to_the_Same_Texture

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!