Notice how Figure 27-1 gives a strong illusion of motion.įigure 27-2 A Scene Without Motion Blur 27.2 Extracting Object Positions from the Depth Buffer This ability allows it to be easily integrated into existing engines targeting hardware that allows sampling from a depth buffer as a texture.įigures 27-1 and 27-2 show how different a scene can look with and without motion blur. The benefit of our technique is that it can be performed as a post-processing step. A motion blur effect can then be achieved by using this velocity vector as a direction to gather multiple samples across the frame buffer, averaging them out along the way to generate a blur. Then we can compute the difference in the viewport position between the current frame and the previous frame in order to generate the per-pixel velocity values. Once we determine the world-space position at that pixel, we can transform it by using the previous frame's view-projection matrix. The pixel shader program computes the world-space positions for each pixel by using the depth value-which is stored in the depth buffer-in conjunction with the current frame's view-projection matrix. In this chapter, we introduce a technique that uses the depth buffer as a texture input to a pixel shader program in order to generate the scene's velocity map. Additionally, some platforms have limited rendering memory and require a tiling mechanism in order to use multiple render targets on frame buffers that are 1280x720 or larger. Another disadvantage is that rendering to multiple render targets may decrease performance on some platforms. A major disadvantage of this strategy is that it requires modifying all the scene's shaders to add code that will calculate velocity and output it to the second render target. Other ways to generate a per-pixel velocity map include using multiple render targets and outputting the velocity information to one of the render targets. Such a multipass approach can be limiting: Many applications cannot afford to send the scene through the entire graphics pipeline more than once and still manage to reach the application's target frame rate. However, adding support for motion blur to an existing engine can be challenging because most motion blur techniques require the scene to be rendered in a separate pass in order to generate a per-pixel velocity buffer. Motion blur also helps smooth out a game's appearance, especially for games that render at 30 frames per second or less. Motion blur can be one of the most important effects to add to games, especially racing games, because it increases realism and a sense of speed. One of the best ways to simulate speed in a video game is to use motion blur. You can also subscribe to our Developer News Feed to get notifications of new material on the site.Ĭhapter 27. The CD content, including demos and content, is available on the web and for download. GPU Gems 3 GPU Gems 3 is now available for free online!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |