Viewports and Clipping

DirectX8

Viewports and Clipping
 
Microsoft DirectX 8.1 (C++)

Viewports and Clipping

Conceptually, a viewport is a two-dimensional (2-D) rectangle into which a three-dimensional (3-D) scene is projected. In Microsoft® Direct3D®, the rectangle exists as coordinates within a Direct3D surface that the system uses as a rendering target. The projection transformation converts vertices into the coordinate system used for the viewport.

You use a viewport in Direct3D to specify the following features in your application.

  • The screen-space viewport to which the rendering will be confined.
  • The range of depth values on a render-target surface into which a scene will be rendered (usually 0.0 to 1.0).

This section discusses clipping, the last stage of the geometry pipeline. The discussion is organized into the following topics.

Direct3D implements clipping by way of a set of viewport parameters set in the device.