How does dynamic rendering work...?
Posted 19 May 2012 - 02:58 AM
Posted 19 May 2012 - 05:53 AM
However, you can also create additional render targets - as many as you want. These offscreen render targets never get displayed directly. They act as scratch space where you can do some rendering, then later use the rendered image as a texture for further rendering. An example of an offscreen render target is a shadow map. You'd draw the scene from the light's point of view, then use that later in a shader to calculate shadows, but the shadow map itself is never directly displayed on screen.
In the case of the dynamic-resolution-rendering article, they're basically suggesting rendering the scene to a variable-size offscreen render target, then stretching that image to the size of the actual back buffer. The point is that by varying the size you can stabilize performance; you can make the buffer smaller and therefore faster when the rendering slows down, and make it larger and more detailed when the rendering is fast.
The "viewport" is the rectangle that the GPU draws into, within the render target. Almost always, the viewport will be equal to the entire render target, but if you wish you can set the viewport to a sub-rectangle, which will cause the GPU to draw a lower-resolution image and leave some of the render target unused. They're using the viewport to change the size of the image because that's faster than deleting and recreating the whole render target at a different size every frame. Instead, they just create the render target once, using the largest possible size, and use the viewport to control the size after that.
Posted 20 May 2012 - 06:45 PM
I'm curious now; how is a new buffer, or render target (or in this case, the viewport-layered-on-top-of-render-target-buffer) created in code? I use Unity right now, and I'm also curious if such software can perform dynamic rendering.
Posted 20 May 2012 - 11:26 PM
Posted 20 May 2012 - 11:47 PM
Posted 23 May 2012 - 01:19 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users