Jump to content

  • Log In with Google      Sign In   
  • Create Account


Post-processing pipeline and render targets


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
3 replies to this topic

#1 colinhect   Members   -  Reputation: 193

Like
0Likes
Like

Posted 18 May 2011 - 09:04 AM

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

Sponsor:

#2 Danny02   Members   -  Reputation: 275

Like
1Likes
Like

Posted 18 May 2011 - 10:03 AM

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


#3 colinhect   Members   -  Reputation: 193

Like
0Likes
Like

Posted 18 May 2011 - 10:07 AM

Perfect. Thanks for the reply.

#4 V-man   Members   -  Reputation: 797

Like
1Likes
Like

Posted 18 May 2011 - 10:37 AM

http://www.opengl.org/wiki/GLSL_:_common_mistakes#Sampling_and_Rendering_to_the_Same_Texture
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);




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