Platform SDK: DirectX |
The perceived speed of an object in a 3-D scene can be enhanced by blurring the object, and by leaving a blurred trail of object images behind the object. Direct3D applications can accomplish this by rendering the object multiple times per frame.
Recall that Direct3D applications typically render scenes into an off-screen buffer. The contents of the buffer are displayed on the screen when the application calls the DirectDrawSurface7.Flip method. Your Direct3D program can render the object multiple times into a scene before it displays the frame on the screen.
Programmatically, your application makes multiple calls to a DrawPrimitive method, repeatedly passing the same 3-D object. Before each call, the position of the object is updated slightly, producing a series of blurred object images on the target rendering surface. If the object has one or more textures, your application can enhance the motion blur effect by rendering the first image of the object with all of its textures nearly transparent. Each time the object is rendered, the transparency of the object's texture is decreased. When your program renders the object in its final position, it should render the object's textures without transparency. The exception is if you're adding motion blur to another effect that requires texture transparency. In any case, the initial image of the object in the frame should be the most transparent. The final image should be the least transparent.
After your application renders the series of object images onto the target rendering surface and renders the rest of the scene, it should call the IDirectDrawSurface7::Flip method to display the frame on the screen.
After your application renders the series of object images onto the target rendering surface and renders the rest of the scene, it should call the DirectDrawSurface7.Flip method to display the frame on the screen.
If your program is simulating the effect of the user moving through a scene at high speed, it can add motion blur to the entire scene. In this case, your application would render the entire scene multiple times per frame. Each time the scene is rendered, your program must move the viewpoint slightly. If your scene is highly complex, your user may see a visible performance degradation as acceleration is increased because of the increasing number of scene renderings per frame.