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 > DS 3D 16-bit texture format issues

#39469 - FeaRog - Sat Apr 09, 2005 7:28 am

I'm messing around with textures in 3D with the 3D example in ndslib, and I find that the green component is always very dull. I'm specifying the texture format as GL_RGBA, and the format i'm using is ABBBBBGGGGGRRRRR, generated by my own tool.

Using a texture with a red stripe, a green stripe, and a blue stripe, the red and blue are vivid and bright, however the green appears like its only half of what it should be (eg 128 as opposed to 255).

Has anyone got any ideas?

Also: if I change the format to GL_RGB (supposedly 16-bit with no alpha), it behaves exactly the same as GL_RGBA - ie if the MSB is not set then it is transparent.

#39472 - ector - Sat Apr 09, 2005 11:41 am

Have you set the current color to white? Maybe the texture is getting modulated by RGB 255,128,255..

#39478 - ecurtz - Sat Apr 09, 2005 3:44 pm

Some of the flags in ndsLib seem to still be "in transition". I was having an issue last night getting a 256 color texture to work and it turned out the flags for 16 color and 256 color textures were reversed.

See if you can figure out what is actually happening in your case and put in a bug report.

#39481 - FeaRog - Sat Apr 09, 2005 4:14 pm

Well, I haven't tested it exhaustively but I think setting the colour to white worked. Check my other post to download the demo I wrote :)

#39525 - dovoto - Sun Apr 10, 2005 12:30 am

Quote:
if I change the format to GL_RGB (supposedly 16-bit with no alpha)


This is not really a texture format. I just added it to be compatible with GL. all it does is set each alpha bit in the texture as it loads it into memory and then changes the mode internaly to GL_RGBA.
_________________
www.drunkencoders.com

#39540 - Darkain - Sun Apr 10, 2005 2:46 am

well, at least for normal PCs, there are a krapload of 16-bit formats....

555
565
5551
4444
etc.

make sure you have the right colour space format. in 565, you have an extra bit for green.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#39984 - Justas - Thu Apr 14, 2005 5:45 am

Darkain wrote:
well, at least for normal PCs, there are a krapload of 16-bit formats....

555
565
5551
4444
etc.

make sure you have the right colour space format. in 565, you have an extra bit for green.


DS advert says that DS can show about 260000 colours, so it must be something more than 16bit format. 18bit for example

#39991 - Darkain - Thu Apr 14, 2005 8:13 am

Justas wrote:
DS advert says that DS can show about 260000 colours, so it must be something more than 16bit format. 18bit for example


i think that is because there are multiple palettes that can all display the same range of colours. the DS is still limited to 16 (15) bit colour. the LCD is 18bit tho, which could be what you are thinking of.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS