[DX9] Transparent pixels: no z-value

Started by
2 comments, last by Juliean 12 years, 6 months ago
Hi,

I'm having a special case of alphablending: I want to use a texture that only has eigther solid (a = 1.0) or completely transparent (a = 0.0) pixels (flags whose edges are torn). I'll have a lot of these objects in nearly every level of the game, so I don't want to waste performance on sorting them from back to front. Is there a way to tell directx not to render completely transparent pixel into the z-buffer?
Advertisement
Yep. Take a look at the bottom of this page.
Sure. Look into "alpha testing" (D3DRS_ALPHATESTENABLE). It's a basic 3D functionality.
If you need accurate boundaries, you might want to look into this paper.
You also have the choice to call clip() in the pixel shader: be careful with that as it interacts poorly with some (most?) D3D9-grade adapters. Alpha testing is your first choice.

Previously "Krohm"

Thank you two, its working alright :)

This topic is closed to new replies.

Advertisement