Transparent textures

Apprentice
Posts: 6
Joined: 2007.08
Post: #1
Hi

At the moment I'm stuck with getting transparent textures applied over a quad. What I want to do is to compose my object from various quads/polygons and use transparent textures for simulating complex layouts (I want to avoid complex polygons). Specifically - I have to parallel quads representing two wings for a biplane, both with transparent textures representing the actual wing shapes.

By using proper blend mode, I can apply textures to the quads and they are transparent. Since I need to freely rotate my object in space, I enabled depth testing. This preserves the layout of the object, but transparency depends on the order of drawing the primitives (I need to do it bottom-up to get it correct). Turning depth testing off makes the transparency work, but then my object is not properly drawn - again I need to change the order of drawing to get it correct.

I've read that transparency is not supported during depth testing, but is there a simple solution for my problem?
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
Yes. Draw your objects from back to front.

This means you need to figure out which object is in front before you draw. Since you're passing in the xyz of each object, and also the projection matrix, you've got all the info you need.
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2007.08
Post: #3
This could be done very easily for different game objects (airplanes in my case), but it would present more problem for individual polygons representing the airplanes (wings, tail, fuselage...) - each airplane could be rotating in 3 dimensions, so it would add quite some complexity to my drawing routines - sometimes I have to draw the airplane from top, then from sides, bottom etc.

The only other way I know of is to make the polygons representing the lines more complex and applying texture without transparency over that. But in my case I'm not doing a full 3D game, just 2D with 3D airplanes, so I so complex rotations and other stuff, so I would prefer transparent bitmaps if possible?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  About transparent colors un textures valle 2 2,783 Oct 26, 2004 09:52 AM
Last Post: valle
  Transparent Color? Josh 6 5,801 Apr 22, 2002 05:27 AM
Last Post: Josh