Page 1 of 1

E3DSurface with alpha blended texture

PostPosted: Dec 4, 2007 @ 6:46pm
by WPennypacker
Hello,

I'm trying to get some equivalent of a Billboarded Quad for a game, using EdgeLib.

To do this, I need to be able to draw a 3D surface with a 2D surface texture applied to it, but that texture must be able to have an alpha mask.

Is this possible?

Thanks a lot.

[UPDATE]

So I've been trying to get a 3D Surface to draw with a 2D RGBA Surface applied as the texture with no results. It just refuses to draw anything.

Finally, by directly calling Render from the Display's 'buffer' surface, I was able to specify a keycolor for a texture and render a 3D surface with an alpha masked texture.

My last problem is that 3D surfaces renderered with anything other than the Display object seem to disregard the World transform.

I suppose I could just ignore the world transform and manage the different coordinate systems myself, but it would be nice to not have to.

Please let me know if I'm missing something entirely, or if theres an easier way to achieve a 3D surface with a masked texture.

Thanks again.

PostPosted: Dec 5, 2007 @ 10:12am
by edge
Hi,

It's not possible to directly render onto a surface and using the world transformation (because it's part of the display object).

However, it is possible to render through the display class using color keyed surfaces. In ClassEDisplay::SetShading you can combine E3D_TEXTURE and EFX_COLORKEY.

Unfortunately, the internal render doesn't support rendering with RGBA surfaces at the moment.

PostPosted: Dec 5, 2007 @ 5:08pm
by WPennypacker
Ah, that worked.

For now, 1-bit alpha is all I really need, so your solution was great.

Thanks a lot.