Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

realtime rendering postprocessing effects

i have a question about real time rendering post processing effects.

how do they work in general? i.e. how do you access the final picture so that you can make changes to it?

do you render it to a texture? if so, how do you make sure the texture fits your screen size?

thanks!

like image 350
clamp Avatar asked Dec 08 '25 22:12

clamp


1 Answers

Basic workflow:

  • Render the scene to a render target / texture (screen-size, usually same format)
  • Reset render target - either to another render target / texture or the actual backbuffer
  • Set the pixel shader for post-processing, bind the scene texture to a sampler
  • Draw a full-screen quad over the scene using a dummy vertex shader

Within the postprocessing pixel shader, access to individual scene pixels is dead simple if you know the normalized x,y position of the current texel (which is given by the texture coordinates of the fullscreen quad interpolated to pixel shader stage).

Many post-processing effects require multiple passes to temporary render targets. An example is the infamous 'bloom' effect: you take the scene texture, subtract out the dark parts, blur and scale the remaining image down (usually done in multiple passes using a ping-pong logic to re-use render targets). The final composition step just adds the bloom texture and the original scene.

like image 152
Alexander Gessler Avatar answered Dec 11 '25 20:12

Alexander Gessler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!