It is currently Thu Oct 19, 2017 9:43 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: spr piexel priority
PostPosted: Wed Jun 08, 2005 5:05 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
im have unclear how sprite pixel priority and colour 0 is managed.

I change my spr render engine to a pixel one, i mean i apply what brad taylor says in his 2C02 reference, i think its the best way, cos its accurate as possible, but my unclear question is that he says that multiplexer do the following to choose if a spr pixel or bk pixel is drawn:

Code:
if ((ObjPrioriy == FORGROUND) || (PFPixel == Transparent)) && (ObjPixel != Transparent))
PrintObjPixel()
else
PrintBKPixel


well this method works in some games but other gives me sprite errors, like some sprites dont display well, the first sprite that i let entry in the sprtemp mem is sprite 0 and his flag, of course, (if it its in range, of course again), and i count to 63 down to 0 to determine the in-range sprite, but...

what about colour 0, when its drawn? some docs says that if bk pixel is xparent and sprite pixel is xparent it uses color 0. Am i wrong?

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 5:20 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Color 0 is transparent for both BG and sprites.

The idea is simple:

If both sprite and BG pixels are transparent, output background color (ppu$3F00 when rendering is enabled). Otherwise:

If Sprite is in foreground:
- if sprite pixel is transparent (0), output BG pixel
- else, output sprite pixel

Else -- sprite is in backgroud:
- if BG pixel is transparent, output sprite pixel
- else, output BG pixel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 2:39 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
that worked disch.

Now i have problems when 2 or more sprites overllaps them self. I mean priority is well but when sprites are in the same scanline there are flickering as if one sprite fights against other.
Something that can help me?

thanks.

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 2:45 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
If you have two nontransparent sprite pixels at the same location, the one belonging to the lowest numbered sprite wins. Always. Even if it's behind the background (in which case you will see the background instead of *either* of the sprites).

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 4:58 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
In other words - you can go from sprite 0 up to 7. If there's a sprite pixel and priority is high, then you don't plot it.

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 3:34 am 
Offline
User avatar

Joined: Thu Mar 24, 2005 3:17 pm
Posts: 355
There's a game where you can test that behaviour. I think it's one of the Megaman games, where you have to jump over the powerbar. Sorry I don't remember the details, but I'm sure someone else does.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 5:16 pm 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
hap wrote:
There's a game where you can test that behaviour. I think it's one of the Megaman games, where you have to jump over the powerbar. Sorry I don't remember the details, but I'm sure someone else does.


Megaman 2, if I'm not wrong.. You can see it easily at the begining of Airman's stage.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 11, 2005 9:06 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7231
Location: Chexbres, VD, Switzerland
Quote:
Megaman 2, if I'm not wrong.. You can see it easily at the begining of Airman's stage.

That's what's written into a PPU doc I've read, but It's pretty frustrating to test because megaman and the bar will alternate their priorities (sprite cyclinge).
The better way to check this is begin a Castlevania game. When you enter in the castle, if Simon passes *trough* the door, the sprite priority is okay. If he passes *in front of* the door, you're not emulating this right.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 11, 2005 11:13 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
An even easier test for this is Super Mario Bros. 3, which uses such sprite masking to make it appear that items come out of [?] bricks and that piranha plants come out of pipes - without proper sprite masking, they will appear in front instead.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group