Skip to main content
gamedev.net
🔒 Locked

Using glBlend with Depth Buffer

Started by davidko Apr 9, 2001 at 11:14 PM 0 replies 550+ views
Original Post
davidko
davidko
In my program, I have a considerable number of polygons that overlap. These polygons are textured with alpha, so that parts of the texture is transparent. To blend correctly, you need to turn off depth-testing. However, I need a way to make it so that the texture's transparent parts are invisible even when the depth buffer is on. (Does that make sense?). This is so that a polygon that's in front of another polygon get drawn that way, and still be able to have invisible parts (where alpha is 0). I tried simply sorting the polygons according to their z values, but that is way too slow for me (because of the sheer number of polys). I need to use the HW depth buffer somehow. Currently, my glBlendFunc is set to SRC_ALPHA and ONE_MINUS_SRC_ALPHA with the depth buffer turned off. thanks for any help, dave Edited by - davidko on April 9, 2001 12:16:37 AM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.