Transparency on textures with direct 3d 9
Posted: Tue Aug 18, 2009 3:03 am
Hmm so I experienced a weird behaviour when using direct 3d 9 and transparent textures. The transparent part of the texture doesn't seem to draw other parts of the same node through the transparency.
This is probably a bad example, but oh well. Here is a screenshot showing what I mean. (models/textures arent mine, took them from some game)
First without transparency (see the white part at the top of the weapon - this is the part on each screenshot which I am referring to)
http://www.anime-fansubs.com/~reiko/tra ... _trans.jpg
Now with transparency on and using direct 3d 9. A little hard to see but the part that should show through on the same node isnt being drawn, instead whats behind (in this case the floor) is being drawn.
http://www.anime-fansubs.com/~reiko/tra ... _trans.jpg
Now with transparency on and using openGL, its drawn exactly as it should be.
http://www.anime-fansubs.com/~reiko/tra ... _trans.jpg
In this particular case it hardly seems like a big deal, but for other cases it can look kinda bad.
Here's a bit clearer example of what I mean:
http://www.anime-fansubs.com/~reiko/kel ... _front.jpg
http://www.anime-fansubs.com/~reiko/kellel_set_back.jpg
The skirt, arms and legs are part of the one mesh. At the bottom of the skirt at the frill part there is some transparency in the texture, but the legs/knees dont show through at that part, instead the background does.
So.. my question is, since I would prefer to use direct 3d 9, how can I get the same behaviour as the way it appears with opengl? Is there some flag I need to set somewhere?
Thanks.
This is probably a bad example, but oh well. Here is a screenshot showing what I mean. (models/textures arent mine, took them from some game)
First without transparency (see the white part at the top of the weapon - this is the part on each screenshot which I am referring to)
http://www.anime-fansubs.com/~reiko/tra ... _trans.jpg
Now with transparency on and using direct 3d 9. A little hard to see but the part that should show through on the same node isnt being drawn, instead whats behind (in this case the floor) is being drawn.
http://www.anime-fansubs.com/~reiko/tra ... _trans.jpg
Now with transparency on and using openGL, its drawn exactly as it should be.
http://www.anime-fansubs.com/~reiko/tra ... _trans.jpg
In this particular case it hardly seems like a big deal, but for other cases it can look kinda bad.
Here's a bit clearer example of what I mean:
http://www.anime-fansubs.com/~reiko/kel ... _front.jpg
http://www.anime-fansubs.com/~reiko/kellel_set_back.jpg
The skirt, arms and legs are part of the one mesh. At the bottom of the skirt at the frill part there is some transparency in the texture, but the legs/knees dont show through at that part, instead the background does.
So.. my question is, since I would prefer to use direct 3d 9, how can I get the same behaviour as the way it appears with opengl? Is there some flag I need to set somewhere?
Thanks.