Transparent textures

Posts: 6
Joined: 2007.08
Post: #1

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
Posts: 1,234
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
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
  OpenGL, SDL, and Transparent Bitmaps RyanA 4 6,854 Jun 26, 2006 04:26 PM
Last Post: RyanA
  About transparent colors un textures valle 2 4,259 Oct 26, 2004 09:52 AM
Last Post: valle
  "boingX" (transparent ogl) under carbon GioFX 2 4,863 Jun 29, 2004 09:08 AM
Last Post: GioFX
  Blending mode for Transparent fog? JeroMiya 2 4,030 Jan 30, 2004 08:09 AM
Last Post: MattDiamond
  Transparent texture color LongJumper 9 7,569 Oct 20, 2003 10:04 PM
Last Post: LongJumper