Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Microsoft® Direct3D® Mobile is capable of clipping all primitives to the view frustum. Clipping is enabled via the D3DMRS_CLIPPING render state (see D3DMRENDERSTATETYPE).
Point primitives can only be clipped by entirely discarding them. Line primitives can be clipped by trimming them into shorter lines or by discarding them entirely. When a triangle is clipped, the result can either be the creation of more triangles, or the result can be to discard the triangle entirely.
The D3DMRS_CLIPPING render state has no effect on vertices that have already been transformed and lit.
All drivers must support scissoring to the screen. Scissoring is the operation where rasterized pixel locations are tested against the dimensions of the render target. The pixel is discarded if it falls outside the viewport.
Clipping Status
If the D3DMVTXPCAPS_CLIPSTATUS capability bit (see D3DMVTXPCAPS Values), is set then it is possible for the application to query the clipping status of the previous primitive processing operation made though a call to either the IDirect3DMobileDevice::DrawPrimitivemethod or the IDirect3DMobileDevice::ProcessVerticesmethod. To determine the result of the clipping operation, applications call the IDirect3DMobileDevice::GetClipStatusmethod. This method takes a pointer to a D3DMCLIPSTATUSstructure that is filled out from the driver's internal data structures.
The application may also reset the driver's internal data structures using the IDirect3DMobileDevice::SetClipStatusmethod. This allows the driver to start processing with a known starting value. The driver will then AND and OR the appropriate bits into the structure as primitives are processed.