#1050 - regularkid - Tue Jan 14, 2003 5:19 am
In a bitmap mode (3 - 5) is it possible to draw over a gba hardware sprite? For example, is it possible to draw a line "behind" the sprite and then a line "in front of" the sprite?
_________________
- RegularKid
#1067 - Quirky - Tue Jan 14, 2003 9:47 am
You can do one or the other, but not both to the same sprite. You only have 2 layers: sprite and background. So a sprite can't be both under the background and on top of it at the same time.
#1086 - Splam - Tue Jan 14, 2003 2:17 pm
You can set the sprite/background priority to in front/behind on alternate lines by using an hdma or hblank interrupt.
#1087 - Splam - Tue Jan 14, 2003 2:21 pm
---ignore this, posted in wrong thread--
#1092 - anli - Tue Jan 14, 2003 2:53 pm
bitmapped backgrounds do not have transparent pixels, so it is probably a bad idea to put sprites behind it. You will not see the sprites.
But.. if you rotate or scale a bitmapped background, you can see whats behind (in non-covered areas).
/anli
#1098 - Splam - Tue Jan 14, 2003 4:58 pm
Pretty sure you're wrong..
As long as the colour is 0 either in 8bpp mode or in the 16bpp modes that pixel is transparent. This is also the reason for them being BG2 and not BG0 so the're mid point and can have priority on either side of them.
hence this from the official docs
Edit: Please do not mention or post information from any official, illegal Nintendo documentation. Thanks.
Just done some test code too and it works..
#1102 - anli - Tue Jan 14, 2003 5:17 pm
The question was about modes 3, 4 and 5, which doesnt have transparent pixels.
Of course, you can draw pixels over a sprite using another sprite, but I didnt understand the question as whether that is possible or not.
To clarify the answer I was giving, in screen mode 3, 4 and 5, you only have one bg layer. You can put sprites in front of that layer or behind that layer. (You can choose to put a number of sprites behind it and another
set of sprites in front of it).
If you choose to put a sprite behind it. It will be covered by it unless the bg layer is scrolled a bit or rotated so they become not covered by it.
Hope I got it right
/anli
#1106 - Splam - Tue Jan 14, 2003 5:54 pm
Yes, modes 3,4 or 5. Which as I said above ARE transparent IF the colour register (or 16bit colour value) is 0.
In my 1st post I explained how to do what was reqired by regularkid, no need to use any other sprites just hblank or hdma.
Please read my posts again. It's all explained.
#1109 - regularkid - Tue Jan 14, 2003 6:36 pm
Thanks. Your advices were helpful. However, I can't use the hblank to update my sprite data because I want to basically turn off and on each column (vertical strip) as it gets drawn. This is because I am trying to make a raycasting game. The enemies will need to be sprites because they can easily be scaled and they provide transparency. However, I am stuck because I need to clip the sprite if there are walls in front of it. So I decided to make a very small z-buffer (just a distance value) for each vertical strip of the walls. Then, when I go to draw the sprite, I wanted to not draw any strips that were farther away than the current column. Make sense (its early so my explanation my not be too clear :) )? Does anyone know of a good way to do this?
_________________
- RegularKid
#1113 - anli - Tue Jan 14, 2003 7:05 pm
Oh, that seems to be a really difficult task.
I think all 3D engines are using bitmapped modes, and leaves sprites aside.
I must also reply on Splams answer:
My mode3 test on
http://www.anderslinden.net/gba/bitmapped_and_transparent/test.gba
reveals that the black color is not treated differently.
If it was, the backdrop color and the rightmost sprite would shine through
the black area of bg2.
/anli
Last edited by anli on Tue Jan 14, 2003 11:53 pm; edited 1 time in total
#1114 - Splam - Tue Jan 14, 2003 7:07 pm
Ahh, vertical :)
Your post makes sense, It was me who said you could do your raycasting thing with sprites if you remember ;)
One way to do it would be to mask the vertical strip by rewriting the data for that strip (could get kind of slow but it's not that bad).
Another way would be to use the 2 gba windows (not to be condused with screens). but there are only 2 of these so you'd be limited to the number of sprites you could mask.
#1124 - regularkid - Tue Jan 14, 2003 8:54 pm
What a coincidence :) In another thread I have on this board someone just mentioned windows also. Good idea.
_________________
- RegularKid
#1135 - icon - Tue Jan 14, 2003 10:10 pm
I think both anli and JCB are lamers... ;-) hahaha...
_________________
Icon member of Parallaxsisters (GBA)
and Remember (c64)
#1139 - Splam - Tue Jan 14, 2003 11:17 pm
icon, get back to lemon, fool :)
@anli
I apologise (always willing to do so when proven wrong), I did my test with a byte per pixel screen and it worked and according to the official Nintendo docs it should work on all modes but obviosuly it doesn't in the 16bpp modes (there are plenty of mistakes in that doc considering its the one developers are given).
#1141 - anli - Tue Jan 14, 2003 11:55 pm
Ah, icon has entered the building!
/anli
#1143 - squeakytoy - Wed Jan 15, 2003 12:09 am
anli wrote: |
I think all 3D engines are using bitmapped modes, and leaves sprites aside. |
V Rally 3 uses a 3D engine for the tracks, but the cars are sprites. They can get away with this because you will always have a clear view of your car - no need for clipping/transparency.
In the 4 car race mode, however, you can see the other cars through walls etc. Due to careful level design, this doesn't happen too often and you don't really notice it much.
#1144 - Splam - Wed Jan 15, 2003 12:10 am
regularkid wrote: |
Official Nintendo GBA Docs? Can you send me a link to them? That would be awsome! Thanks. |
hehe you trying to get me killed or something? I wish I could send you a link but you have to be a registered developer with Nintendo and get a password to downlod them and I'm not taking the chance of giving them out.
#1146 - regularkid - Wed Jan 15, 2003 12:14 am
Awww! Its ok, I understand. What company do you work for?
_________________
- RegularKid
#1147 - Splam - Wed Jan 15, 2003 12:39 am
None at the moment. Waiting for a freelance contract and doing my own stuff.
There's really not much in them that isn't documented elsewhere and unfortunatly (as seems the case this time) there ARE mistakes in there.