#176749 - narre - Tue Oct 04, 2011 12:04 am
Wiki says that both ds lcds are capable of 18bit color depth(262,144 colors). But from what i've seen and read from the source code headers is that you can only have 16bit color depth at max.
I don't get this! Is there something i'm missing? How do you do the 18bit color depth programming on the ds?
Fyi, I'm trying to create a color palette color for my paint program and i need all the colors i can get. And I never had any experiences with color programming but I'm willing to learn.
Thankxx in advance. ;)
#176750 - elhobbs - Tue Oct 04, 2011 1:42 am
you can only directly use 15 bit color. internally colors calculations are 18 bit. there is a thread on this already with a sample that shows the effect of blending 2 layers to get 18 bit color.
http://forum.gbadev.org/viewtopic.php?t=15748&highlight=18bit
I used search to find this, crazy right? ;)
#176751 - narre - Tue Oct 04, 2011 2:11 am
LOL!! Thanks for the help. I did search with 18bit color keyword but the result was too much, around 12 pages. I read most of tutorials out there and i didn't find a clue how to do the 18bit color depth programming. N the main reason i posted here was because I don't have any experience with color.
Thanks a lot!!?# ;)
#176754 - sverx - Tue Oct 04, 2011 3:56 pm
narre wrote: |
But from what i've seen and read from the source code headers is that you can only have 16bit color depth at max. |
Actually the color is 15bpp, 5 bits for each component color. The high bit is used for alpha (mask) in some cases, for instance with bitmap BGs.
Mixing (alpha blending) two BGs you can obtain a REAL 6 bits for each component color, which gives in fact 18bpp images.
#176769 - LOst? - Sat Oct 08, 2011 12:49 pm
Sorry, this might be the stupidest question yet, but:
So it won't be possible to emulate a DS screen with just 16 bpp colors as some blending modes will not work?
18 bpp means that an emulator that emulates the DS screens must use at least 24 bpp or 32 bpp to emulate all colors correctly? Does this apply to GBA too?
_________________
Exceptions are fun
#176770 - headspin - Sat Oct 08, 2011 1:37 pm
PC's these days have 32-bit colour as their default display mode so it doesn't really mean much.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game
#176776 - sverx - Mon Oct 10, 2011 10:45 am
LOst? wrote: |
So it won't be possible to emulate a DS screen with just 16 bpp colors as some blending modes will not work? |
no$gba doesn't emulate that 18bpp mode, for instance. But it isn't so much important. Hardware does it, anyway.
#176958 - Exophase - Mon Nov 07, 2011 9:32 pm
LOst? wrote: |
Sorry, this might be the stupidest question yet, but:
So it won't be possible to emulate a DS screen with just 16 bpp colors as some blending modes will not work?
18 bpp means that an emulator that emulates the DS screens must use at least 24 bpp or 32 bpp to emulate all colors correctly? Does this apply to GBA too? |
Doesn't apply to GBA.
Last I checked all the emulators out did everything in 16-bit, at least for the software renderers. The banding vs a real DS can be pretty noticeable, since there isn't any dithering. But it doesn't outright break things, per se.
I've always been under the impression that on DS the 2D layer mixing was done in 15-bit like on GBA. But we know that the 3D layer is 18-bit, and that's a possible source for the 3D compositor, so it stands to reason that it'd have to mix in 18-bit, even though there are still only 4 bits for the blend coefficients. Same is probably true for master brighten/darken modes.
Textures are 15-bit like mentioned.. also, per-vertex color information generated by the geometry engine is only 15-bit too, even though they could have made it higher. Gouraud shading is done in 18-bit, and I would expect texture combining and alpha blending to be too.
Note that while the 3D engine outputs 18-bit (plus 5 bits of alpha) the game can only capture 15-bit. So even if an emulator is wrong the game wouldn't necessarily be able to tell, depending on what's being done internally. Not that any DS emulators are that accurate otherwise.