Z-buffer and special effects in DDraw 7

Started by
1 comment, last by LordReaper 22 years, 1 month ago
Hi I was playing around with the Blt funcion and AlphaBlt and I found at the DDBLTFX struct som Fx''s I didn''t understand. What is the Z-buffer, what it does, what it could help in a game, and how to set it, and I wanted also to know the best way to do any blit, alpha or not, in the faster way. And another question, could anyone direct me to a list of the DDBLTFX effects and also for alpha blt FX. Thanks!
The Dark Wind begins to blow...
Advertisement
Z-buffer is a depth buffer for culling hidden surfaces. Blt and BltFast are the two bliting functions, BltFast doesn''t support clipping but is supposed to be faster.

The DirectX documentation (or google) should provide you with a list of DDBLTFX effects.

,Jay
A z-buffer buffer is a really straightforward concept. For each pixel, both the colour (as you''d expect) and a distance value are stored. Each time a value is to be written to the z-buffer, the distance is checked. If the value is closer then the pixel colour and distance is updated. This way, closer pixels overwrite further away ones and you get proper depth.

The downside to a z-buffer is that it uses quick a lot of memory, but these days it''s done in hardware. It''s great for 3D scenes.

This topic is closed to new replies.

Advertisement