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 > help with understanding colormode in 3d. 8bit/16bit

#106373 - Rockard - Wed Oct 18, 2006 1:26 pm

I am currently making a spritesystem for 3d, and so, for this dream to come true, I need to be able to use a lot of textures.

I have checked the examples in ndslib, and the textures there are always converted from 8bit to 16bit-colormode. I have a feeling this will fill up a lot of memory, and won't allow a lot of textues for my "sprites".. =/

Is 3dmode always in 16bit mode? Is it obligatory to convert the 8bittextures to 16bit for them to work in 3d mode? Can I use 3dmode in 8bit-mode? Maybe assign different palettes to textures like in 2d-mode?

I have not run out of memory yet, but I have a feeling I will somewhere along the way. So, does anybody have a solution to this, or can explain some elementary stuff for me?

Thank you!

#106377 - Lick - Wed Oct 18, 2006 2:48 pm

http://www.bottledlight.com/ds/index.php/Video/RasterizingEngine

See 'Texture Formats'. ;)

- Lick
_________________
http://licklick.wordpress.com

#106381 - Rockard - Wed Oct 18, 2006 3:47 pm

AAAAAAAAAHhhhhhhhhhhh... looks great. =)

Uhm, anybody willing to just give a little nod how to set this values?
I have read some tutorials, but I have still no idea how I am about to use these tables.. =(

Are these adresses linked to functions, or how am I about to access them?

#106440 - Rockard - Thu Oct 19, 2006 12:35 am

I used this tutorial as a template
http://lazmike.nintendev.com/tutorials/nehe6/

He converts the pcx to 16bit format.
So, instead, I comment out this line.

Then I change this:
glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_128 , TEXTURE_SIZE_128,
0, TEXGEN_TEXCOORD, pcx.data8);

to this:
glTexImage2D(0, 0, GL_RGB256, TEXTURE_SIZE_128 , TEXTURE_SIZE_128,
0, TEXGEN_TEXCOORD, pcx.data8);

so that it treats it as a 256 color texture. When I load this, the texture turns out white. =(

Either I have understood this wrong, or I think I need to set a palette somehow.

Am I right? How do I do it?
Can I assign many palettes to textures, just like the sprite system?

please help a silly noob.. :(