#45586 - Ultima2876 - Sun Jun 12, 2005 9:14 am
Are there any clever ways to get 64x8 sprites? I cant use 32x8 because then I need two sprites, which means I'll go over the sprite limit. At the moment I've got it with 32x8, and flip-flopping it, but it still doesn't look very good. Any ideas?
#45588 - DekuTree64 - Sun Jun 12, 2005 10:09 am
What is it you're trying to do? If you're hitting the 128 OAM limit you could try multiplexing, but there could be less tricky ways to go about getting the effect you want too.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#45610 - Ultima2876 - Sun Jun 12, 2005 6:37 pm
I'm making lasers. The thing is, they look really good as they are, with them being 32x8 and being flip flopped - except for the bit in the middle, it stands out like a sore thumb.
One thought I had was to record the Y location of the laser, then in Hblank when REG_VCOUNT is equal to that Y location + 4, move the laser below the screen. It didn't work - I think it was too slow =/
The reason I'm hitting the sprite limit is due to all the other sprites - enemies, players, shots, HUD parts, explosions etc.
Thanks.
#45616 - tepples - Sun Jun 12, 2005 8:21 pm
If you draw a 64x8 pixel sprite cel (say at tile locations 640-647 in sprite cel VRAM), you can display it using 2 sprites (each 32x8 pixels, set to 640 and 644).
If you're hitting the 128 sprite limit, now is the time to start multiplexing.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#45618 - DekuTree64 - Sun Jun 12, 2005 8:24 pm
Hmm, is there any way you could use a BG for it? Maybe by drawing the lasers on one of the normal BGs, and swapping the char data between laser and transparent every frame.
Another possibiliy would be scaling your 32x8 sprite with double-size on. But if you have enough sprites to hit the limit, you'd most likely get dropout cause double-size scaled sprites burn GPU cycles like crazy.
Multiplexing probably would work best if you can't use a BG. Instead of dong it in HBlank, use the VCount interrupt so it only happens on lines where you actually need to do something.
On each VCount, copy the OAM values for the next laser (sorted by Y coordinates) into whatever OAM entries to designate for lasers, and set up the next VCount.
VCount happens right at the START of a line, so you'll need to trigger it at least one line above where the sprites will actually appear. Safest to go several lines above, and have 2 sets of laser sprites. While laser A is being displayed, laser B is being moved. Then as soon as A is finished drawing, move it and wait until B finishes drawing. Keep flip-flopping until you've done all your lasers.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku