سؤال

the last few days i was reading a lot articles about post-processing with bloom etc. and i was able to implement a render to texture functionality with this texture running through a sperate shader. Now i have some questions regarding the whole thing.

  1. Do i have to render both? The Scene and the Texture put on a full-screen quad?
  2. How does Bloom, or any other Post-Processing (DOF, Blur) with this render to texture functionality work? Or is this something completly different?
  3. I dont really understand the concept of the Back and Front-Buffer and how to make use of this for post processing.
  4. I have read something about the volumetric light rendering where they render the scene like 6 times with different color settings. Isnt this quite inefficient? Or was my understanding there just incorrect?

Thanks for anyone care to explain this things to me ;)

هل كانت مفيدة؟

المحلول

Let me try to answer some of your questions

  1. Yes, you have to render both
  2. DOF is typically implemented by rendering a "blurriness" factor into an offscreen buffer, where a post-processing filter then uses this factor to blur certain pixels more than others (with some compensation for color-leaking between sharp and blurred objects). So yes, the basic idea is the same, render to a buffer, process it and then display it (with or without blending it on top of the original scene).
  3. The back buffer is what you render stuff to (what the user will see on the next frame). All offscreen rendering is done to other rendertargets that you will create and use.
  4. I don't quite understand what you mean. Please provide a link to what you read so I can try to understand and perhaps explain it.

نصائح أخرى

Suppose that:

  1. you have the "luminance" for each renderer pixel in a single texture

  2. this texture hold floating point values that can be greater that 1.0

Now:

You do a blur pass (possibly a separate blur), only considering pixels with a value greater than 1.0, and put the blur result in another texture.

Finally:

In a last shader you do the final presentation to screen. You sample from both the "luminance" (clamped to 1.0) and the "blurred excess luminance" and add them, obtaining the so-called bloom effect.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top