Clipping and D3D

Started by
1 comment, last by master_ball 21 years, 10 months ago
Hi I''ve used some basic D3D for a while now, but I am now wanting to do some clipping. I know you have to declare a special surface when using DirectDraw, but what about D3D??? - master_ball ---------------------------- We R 138
-- master_ball --------------------------------student seeking future game dev career, advice welcome
Advertisement
AFAIK you don''t need anything equivalent to DD clippers for D3D8.
---visit #directxdev on afternet <- not just for directx, despite the name
Yep, the projection matrix and viewport parameters are all D3D needs to clip.

The projection matrix transforms into clip space. In clip space any points which are visible have coordinates between -1 and 1 (0 and 1 for Z) - any coordinate outside of that range gets clipped. Simple.

The viewport determines how the clipped vertices are transformed into the screen rectangle.

[Modern graphics chips also have a thing called "Guard Band Clipping" which is (conceptually) like having a bigger surface for your back buffer so that polygons which straddle the edges of the viewable screen don''t have to be clipped, the bits outside of the viewable area just get drawn into the guard band space. It means the chip can trivially accept/reject more geometry which makes things faster]

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement