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.

Graphics > Low priority sprites underneath sprites - does it mask?

#69777 - Dwedit - Wed Feb 01, 2006 8:26 pm

If you place an low priority sprite underneath a normal priority sprite, will it mask off the areas of the low priority sprite, just like a NES?

edit: oops, this probably belongs in Coding...
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#69794 - tepples - Wed Feb 01, 2006 10:58 pm

Dwedit wrote:
If you place an low priority sprite underneath a normal priority sprite, will it mask off the areas of the low priority sprite, just like a NES?

On the GBA, yes, the priority system behaves as it did on the NES. On the Nintendo DS, no; Nintendo "fixed" the behavior.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#69798 - wintermute - Wed Feb 01, 2006 11:40 pm

Are you sure about that?

Isn't Dwedit asking about that weird NES trick where the low priority sprite was masked by transparent areas of the higher priority one?

What behaviour has been fixed on the DS?

#69799 - tepples - Wed Feb 01, 2006 11:49 pm

wintermute wrote:
Are you sure about that?

Isn't Dwedit asking about that weird NES trick where the low priority sprite was masked by transparent areas of the higher priority one?

Yes, and the trick works on the GBA in the same way as on the NES. The compositor in both systems can be modeled in the same way: render all backgrounds to one buffer (sorted by priority and storing the priority of each pixel in a Z buffer), render sprites to another buffer (strictly front to back, using priority only to fill the Z buffer), and combine the buffers according to Z value (with sprites winning ties).

Quote:
What behaviour has been fixed on the DS?

Martin Korth's GBATEK (DS edition) states that in DS mode, the 2D compositor now sorts the sprites by Z before rendering them to the buffer.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#69805 - wintermute - Thu Feb 02, 2006 1:00 am

you learn something new every day :) I didn't realise the GBA did that as well

#69828 - Dwedit - Thu Feb 02, 2006 7:08 am

Are you sure it applies to the DS in both modes? A good way to test it is Mario 3 in pocketnes and nesds.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#69899 - FluBBa - Thu Feb 02, 2006 9:17 pm

In PocketNES I had to use the blending to get the exact behaviour of the NES, Loopy changed the sprite priority for nesDS so he could use the alpha-lerp scaling.
_________________
I probably suck, my not is a programmer.