Reputation: 34016
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!
Upvotes: 3
Views: 1554
Reputation: 46607
Basic workflow:
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.
Upvotes: 6