#70616 - ProblemBaby - Tue Feb 07, 2006 8:15 pm
Hi
I dont understand the new thing when the palette index instead is an alpha value for bitmap sprites! I can only see that 0 dont show and !0 shows it, but with no different opacity like I thought! is it something in the blend control that have to be enabled or is the alpha value something else?
thanks
#70674 - HyperHacker - Wed Feb 08, 2006 4:16 am
I haven't worked with sprites, but with solid bitmaps there's only one bit of alpha. There are two things I can think of a single-bit alpha might be used for:
1) Each bitmap and/or sprite has its own global alpha value, applying to every pixel without that bit set. (If you set the sprite's alpha to 65%, then 0=65%, 1=100%.)
2) The bit is not truly an 'alpha' bit but a 'transparent' bit. (Easy confusion as many people say transparent, meaning invisible, when they mean translucent.) 0=don't show, 1=show. The idea is to be able to use all 32,768 colours and still have a way to omit pixels so that the image below shows through.
#2 seems more likely, but #1 would make more sense. Gameboy sprites didn't have an alpha bit for each pixel; they simply omitted any pixel with colour 0. Seeing as Gameboy sprites could only have 4 different colours, and DS sprites can have 65,536 (or more likely 32,768), it seems to me this method would work fine for DS as well. (If you want black, just use like R=0, G=0, B=1 instead.)
#70737 - ProblemBaby - Wed Feb 08, 2006 1:48 pm
Yeah thats the same for bitmap sprites (A1,B1,G1,R1) and its transparent if its 0 and else visisble, but the thing Iam wondering about is the thing specifications talk about: bit 12-15 in attr2 (known as the palette index) is on bitmap mode changed to an alpha value.
But I can only see difference between 0(transparent) and !0(visible) nothing in between.
#70899 - M3d10n - Thu Feb 09, 2006 1:04 pm
You mean, having pixels with varying alpha levels (like an alpha channel)? I am not sure, but I don't think the 2D sprites support that, unless you setup the blending values to get an additive effect, but that causes a different effect.
The 3D hardware, however, does support alpha-values on the textures, so maybe you could use 3D planes as sprites, or find a way to put a 3D layer on top of your sprites and use it for alpha-blended stuff.
#71010 - ProblemBaby - Thu Feb 09, 2006 11:52 pm
The thing is that both No$gba spec and dslib spec talks about an alpha channel for bitmap sprites. But no one tells how to use them. Probably you have to enable something, Ive tried some different reg_bldcnt settings but without success.
Have no one used this effect?