Sprite color combination

Página 2/3
1 | | 3

Por [D-Tail]

Ascended (8259)

Imagen del [D-Tail]

03-01-2008, 19:20

SLotman is very right. Actually, it doesn't make sense to render more than 4 sprites over each other (why: 0001 OR 0010 OR 0100 OR 1000 gives all possible combinations). These are the color codes and do not represent sprite/plane numbers!

Por GhostwriterP

Paladin (680)

Imagen del GhostwriterP

03-01-2008, 19:51

Metalion: Why do you OR pairs 5/2 4/1 3/0 instead of 5/4 3/2 1/0? If they colide the OR order will be messed up... unless it is what you want ofcourse. Then it is not a mess but some cool effect.

Btw does the cc bit has to be set on every color line (16x) ?

Por [D-Tail]

Ascended (8259)

Imagen del [D-Tail]

03-01-2008, 20:04

GhostwriterP: yes, the CC bit has to be set on all color lines in order to have the sprites blend in completely. On lines where CC is not set, the sprite with higher priority will overlap. Moreover: Metalion happens to have three solid sprites (0, 1 and 2) and happens to have three OR-able sprites (3, 4 and 5). Now, these sprites respectively collide with eachother. Technically it should just work. I'm a bit confused why it doesn't.

Stuff to check:
What gets displayed in the #3/#0 combination when #3 and #0 have the same co-ordinates: #3, or #0? [Should be #0]
Can you display #0 normally? [If #0 has a definitive shape [name table], the color lines are set accordingly [color table] and the attributes are right [X, Y, layer], it should]
Can you display #3 normally? [etc]

Then this piece should just work!

Por turbor

Champion (507)

Imagen del turbor

03-01-2008, 23:04

If I'm not mistaken the algorithm that does the color OR-ing simply stops checking for more "OR"-colors as soon as a higher priority sprite is found that hasn't have the CC bit set on the current display/scanline.
So if pair 0/3 is perhaps on the same y-height as the pair 1/4 or at least partially overlapping in height then the transparency check for sprite 3 might get stopped by the fact that sprite 1 doesn't have the CC bit set
As a rule of thumb it is always advisable to pick pairs like 0/1 , 2/3, 4/5 just for these kind of reasons. Or more precisely: a base sprite and then the needed OR sprites, then again the base and its OR sprites, and repeat at infinum. ( or until all your sprites are used ofcourse Wink )

Por Metalion

Paragon (1591)

Imagen del Metalion

04-01-2008, 07:13

What gets displayed in the #3/#0 combination when #3 and #0 have the same co-ordinates: #3, or #0? [Should be #0]
What is displayed is sprite #0 overlapping sprite#3 without an OR effect.

Sprite #3 and sprite #0 have the coordinates X,Y (OR effect does not work)
Sprite #4 and sprite #1 have the coordinates X+16,Y (OR effect works)
Sprite #5 and sprite #2 have the coordinates X+8,Y+16 (OR effect works)

I will try to rearrange them by closer pairs (0/1, 2/3 and 4/5) to see if it works, although I don't understand why it does not work in this present combination.

Por ro

Scribe (4817)

Imagen del ro

04-01-2008, 07:55

OR? wasn't it XOR ? aaah, what do I know.
I also thought that only the next sprite could OR/XOR with the base sprite (e.g. 0+1, 2+3 etc).
again, I dunno nothing about funny!

I even wrote an article on this subject long ago, iirc. coffee anyone?

Por PingPong

Prophet (3987)

Imagen del PingPong

04-01-2008, 10:53

Metalion: what screen mode are you using?. What language are you using ? Maybe with a vram dump someone can help...

Por Metalion

Paragon (1591)

Imagen del Metalion

04-01-2008, 17:24

Metalion: what screen mode are you using?. What language are you using ? Maybe with a vram dump someone can help...
I am using SCREEN5 mode, and I am developing in ASM.

Here is the overlapping sprites (the OR should give a gray color on the left side, like you see on the right side and below):

pagesperso-orange.fr/soyeur/eBay/planeur.png

Here is the VRAM dump for the color table :

pagesperso-orange.fr/soyeur/eBay/couleurs.png

Here is the VRAM dump for the attribute table :

pagesperso-orange.fr/soyeur/eBay/attributs.png

Por GhostwriterP

Paladin (680)

Imagen del GhostwriterP

04-01-2008, 19:58

So if pair 0/3 is perhaps on the same y-height as the pair 1/4 or at least partially overlapping in height then the transparency check for sprite 3 might get stopped by the fact that sprite 1 doesn't have the CC bit setSprite #3 and sprite #0 have the coordinates X,Y (OR effect does not work)
Sprite #4 and sprite #1 have the coordinates X+16,Y (OR effect works)

Big smile

Por Metalion

Paragon (1591)

Imagen del Metalion

04-01-2008, 20:23

I don't understand the VDP logic here ...

Let's say that when a sprite has the CC bit set, the VDP searches up the priority ladder for the first sprite which has a CC bit reset to make the OR effect and then stops there.

In my case, for sprite 3 - 4 - 5 the first CC-bit reset sprite that the VDP finds is sprite 2, so it would mean that the OR effect would only works with the 5/2 pair ... (which is not the case).

Now, let's say that when a sprite has the CC bit set, the VDP searches up the priority ladder for the first sprite which has a CC bit reset AND overlapping pixels to make the OR effect.

That would work with all my sprite pairs ... Sad

Página 2/3
1 | | 3