Transparent textures
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?
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?
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.
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.
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?
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?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL, SDL, and Transparent Bitmaps | RyanA | 4 | 3,362 |
Jun 26, 2006 04:26 PM Last Post: RyanA |
|
| About transparent colors un textures | valle | 2 | 2,476 |
Oct 26, 2004 09:52 AM Last Post: valle |
|
| "boingX" (transparent ogl) under carbon | GioFX | 2 | 2,897 |
Jun 29, 2004 09:08 AM Last Post: GioFX |
|
| Blending mode for Transparent fog? | JeroMiya | 2 | 2,423 |
Jan 30, 2004 08:09 AM Last Post: MattDiamond |
|
| Transparent texture color | LongJumper | 9 | 3,772 |
Oct 20, 2003 10:04 PM Last Post: LongJumper |
|

