#155178 - ZeroSum - Sat Apr 26, 2008 1:25 am
I'm having some trouble using transparent textures. I searched around a bit and found out about the GL_TEXTURE_COLOR0_TRANSPARENT option but now I have a slightly different problem as described below. I've uploaded a few pictures to help my probably crappy explanation: :)
Without GL_TEXTURE_COLOR0_TRANSPARENT:
Link
With GL_TEXTURE_COLOR0_TRANSPARENT:
Link
The scene is just three quads. One untextured at the back which covers the screen, one textured with a building on the left and one textured with ground on the right. As you can see the building texture is transparent on the "inside" as well as around it. The transparent areas on the inside of the building are supposed to be black.
All of my textures are 16 colour with palettes with magenta (FF00FF) as the wanted transparent areas. I used Nomad NDS Texture Converter to convert the images. When exporting I ticked the option for a transparent colour and selected magenta.
I have a feeling that when I do this Nomad is just turning on the "this pixel is transparent bit". When loading the textures without the GL_TEXTURE_COLOR0_TRANSPARENT flag the wanted area is "transparent" as in there is no magenta, but of course it's not see through. I then found I needed to set that flag and it has worked for the right hand texture but not the left.
I'm guessing that for the building on the left black is the first colour (in position 0) in the palette so its making this transparent as well as the pixels marked with the transparent bit.
If this is the case can anyone recommend a texture converting tool where I can choose the palette order myself or one that will put a chosen colour as the first in the palette? I have gfx2gba but I'm unsure if this can do textures or what options to use.
Thanks for reading.
PS. If someone could provide a link about or a brief explanation on how textures are formatted for the DS I would like to try writing my own converter for the experience.
Without GL_TEXTURE_COLOR0_TRANSPARENT:
Link
With GL_TEXTURE_COLOR0_TRANSPARENT:
Link
The scene is just three quads. One untextured at the back which covers the screen, one textured with a building on the left and one textured with ground on the right. As you can see the building texture is transparent on the "inside" as well as around it. The transparent areas on the inside of the building are supposed to be black.
All of my textures are 16 colour with palettes with magenta (FF00FF) as the wanted transparent areas. I used Nomad NDS Texture Converter to convert the images. When exporting I ticked the option for a transparent colour and selected magenta.
I have a feeling that when I do this Nomad is just turning on the "this pixel is transparent bit". When loading the textures without the GL_TEXTURE_COLOR0_TRANSPARENT flag the wanted area is "transparent" as in there is no magenta, but of course it's not see through. I then found I needed to set that flag and it has worked for the right hand texture but not the left.
I'm guessing that for the building on the left black is the first colour (in position 0) in the palette so its making this transparent as well as the pixels marked with the transparent bit.
If this is the case can anyone recommend a texture converting tool where I can choose the palette order myself or one that will put a chosen colour as the first in the palette? I have gfx2gba but I'm unsure if this can do textures or what options to use.
Thanks for reading.
PS. If someone could provide a link about or a brief explanation on how textures are formatted for the DS I would like to try writing my own converter for the experience.