gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Question concerning textures and transparency.

#73723 - Dark Knight ez - Mon Feb 27, 2006 8:50 pm

Hey everybody.

I was wondering if it was possible to have a quad with a texture, of which the part of the quad overlayed by the "transparent" part of the texture is not shown.

It becoming some sort of a sprite, but being able to give it x, y and z coordinates.

Or is there an easy way to do the same thing with a sprite? (Haven't looked into that yet.)

I'm creating a 3D environment, and such a thing would come in handy as it would reduce the need to model quite a few things (which I'm not capable of doing yet anyway).

I've searched on transparency and textures and such, but could only find alpha blending (which is for the entire quad, right?) and obtaining an alpha-bit from a texture (which can probably only be used for alpha blending the entire quad).

Thanks in advance,
Dark Knight ez.

#73728 - Webez - Mon Feb 27, 2006 9:16 pm

I haven't tested it but devoto uploaded some paletted texture examples with alpha channel into sourceforge

#73852 - Dark Knight ez - Tue Feb 28, 2006 11:56 am

Thanks for your reply. The demo looks quite nice and is exactly what I've been looking for.

I'm facing a problem however.
I've tried converting my pcx-texture to the required formats (a texture-bin-file and a palette-bin-file), but using these two files in the demo gives me transparency where I want it but the non-transparent part is glitchy (as in: showing garbage).
Is there something specific I need to do to obtain proper files for a "GL_RGB32_A3" format? (The comment on this format says: 32 colour textures, 8 levels of alpha)

The way I've done it now is to just save the palette with Photoshop as a pal-file, and renamed that to bin... and converted the pcx file to a bin file and renamed that to a bin as well.

Do I need to do something to make the pcx-file 32 colour? What am I doing wrong?

greets,
Dark Knight ez.

#73854 - Extreme Coder - Tue Feb 28, 2006 1:06 pm

Do you know the tools needed to convert into paletted textures? since i dont know how to convert images into them:(

#73880 - Dark Knight ez - Tue Feb 28, 2006 7:18 pm

Well, as stated above, I'm doing something wrong though I do not know what it is exactly.

To convert a pcx to a bin file, I used a graphics tool which can be found at drunkencoders (which can also convert md2 files).
For the palette, I just saved it with Photoshop and then renamed it to bin... though that might be my problem. Maybe I need a program to convert the pal-file created to a bin-file instead of just renaming... anyone know a program to use for this goal?

#73902 - Sausage Boy - Tue Feb 28, 2006 9:29 pm

gfx2gba v0.13 will be able to create palette and bin from a pcx.
_________________
"no offense, but this is the gayest game ever"

#73911 - Dark Knight ez - Tue Feb 28, 2006 9:41 pm

So I've noticed, but only when using 8bit.
I've tried that and it had the same outcome (garbage colours, but what needed to be transparent is).

#73915 - Sausage Boy - Tue Feb 28, 2006 10:10 pm

uhm yeah, that may be a problem. :P

Doesn't that .Net PAlib program do this stuff?
_________________
"no offense, but this is the gayest game ever"

#73992 - Extreme Coder - Wed Mar 01, 2006 1:12 pm

Sausage Boy: I guess you're talking about pagfx, nope, its still in the todo list:P isnt gfx2gba v0.13 already out a long time ago?

Dark Knight EZ:The tool you're talking about is dsutils(texconv to be exact), but i think u can use it when u r converting to only a tex, not with its pal. Maybe dovoto or joat would know of a tool..