How is this Predator-style effect achieved?

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
SNES AYE
Posts: 323
Joined: Mon Nov 07, 2022 11:28 am

How is this Predator-style effect achieved?

Post by SNES AYE »

Can someone explain how the following Predator-style invisibility cloak effect is achieved on SNES during this boss battle:

https://youtu.be/_Iki75JwBcE?t=971
creaothceann
Posts: 787
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How is this Predator-style effect achieved?

Post by creaothceann »

Load it into Mesen, see what it does in the debug windows. Especially Sprite Viewer, Tilemap Viewer, Register Viewer (PPU), Palette Viewer and Event Viewer.

BG Mode is 1. BG layers 1 and 2 show the background (layer 1 a bit more, but it's offscreen), layer 3 is the HUD. Mainscreen has every layer enabled, the subscreen has only BG2 enabled. BG1 tiles use palette 7 while BG2 tiles use palette 6, this will be important later.

HDMA is used to alter the horizontal position of BG layer 2, giving it a wavy-like effect.

Color math is enabled for the sprites, to which the subscreen is added - i.e. BG layer 2. (Sprites with palettes 0..3 are never affected by color math though.) The player sprites use palette 0, and the enemy sprites use palette 4. This explains why the player is not affected by the effect.

The effect starts out with the enemy palette (4) set to black and BG2 palette (6) being the same as the palette used by the BG1 tiles (7). The enemy fading in is done by palette 4 getting brighter and palette 6 getting darker.

Quite a nice effect, I don't think I've seen this one before.
Attachments
NinjaWarriors.png
Mesen savestates - Ninjawarriors.7z
(510.33 KiB) Downloaded 10 times
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
SNES AYE
Posts: 323
Joined: Mon Nov 07, 2022 11:28 am

Re: How is this Predator-style effect achieved?

Post by SNES AYE »

creaothceann wrote: Thu May 08, 2025 12:50 pm Load it into Mesen, see what it does in the debug windows. Especially Sprite Viewer, Tilemap Viewer, Register Viewer (PPU), Palette Viewer and Event Viewer.

BG Mode is 1. BG layers 1 and 2 show the background (layer 1 a bit more, but it's offscreen), layer 3 is the HUD. Mainscreen has every layer enabled, the subscreen has only BG2 enabled. BG1 tiles use palette 7 while BG2 tiles use palette 6, this will be important later.

HDMA is used to alter the horizontal position of BG layer 2, giving it a wavy-like effect.

Color math is enabled for the sprites, to which the subscreen is added - i.e. BG layer 2. (Sprites with palettes 0..3 are never affected by color math though.) The player sprites use palette 0, and the enemy sprites use palette 4. This explains why the player is not affected by the effect.

The effect starts out with the enemy palette (4) set to black and BG2 palette (6) being the same as the palette used by the BG1 tiles (7). The enemy fading in is done by palette 4 getting brighter and palette 6 getting darker.

Quite a nice effect, I don't think I've seen this one before.
OK, I think I understand. Thanks.

I expect this example that I also just noticed today is doing something very similar:

https://youtu.be/PTTvZIO7jVA?t=1491

Edit: Also, I've always thought this silhouette effect was very nice in World of Illusion:

https://youtu.be/pcVO7TZ9yzM?t=1883

And now I expect it might be possible to achieve something similar on SNES using the same method as that NinjaWarriors boss, which would be cool to see used in some way. Does it look to you like that SNES subscreen exploit might indeed work for this kind of effect as well?
User avatar
dink
Posts: 234
Joined: Sun Jan 12, 2020 8:42 pm

Re: How is this Predator-style effect achieved?

Post by dink »

In World of Illusion on Genesis/MD, I think it's using the Shadow/Hilight feature of the vdp to achieve that effect
creaothceann
Posts: 787
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How is this Predator-style effect achieved?

Post by creaothceann »

SNES AYE wrote: Fri May 09, 2025 4:13 am Edit: Also, I've always thought this silhouette effect was very nice in World of Illusion:

https://youtu.be/pcVO7TZ9yzM?t=1883

And now I expect it might be possible to achieve something similar on SNES using the same method as that NinjaWarriors boss, which would be cool to see used in some way. Does it look to you like that SNES subscreen exploit might indeed work for this kind of effect as well?
You could perhaps do something with a window.

- put the backgrounds and sprites on the mainscreen
- put a window at the same coordinates as the curtain (can even be wavy with HDMA)
- enable the window for mainscreen sprites
- set CGWSEL (MM bits) to black out the affected pixels

This will create black sprite pixels. Color math (with the fixed color) could then perhaps be used to add some color back, so that it appears gray.

(Not sure if the latest versions of SNES9x/ZSNES really don't support this?)
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
SNES AYE
Posts: 323
Joined: Mon Nov 07, 2022 11:28 am

Re: How is this Predator-style effect achieved?

Post by SNES AYE »

dink wrote: Fri May 09, 2025 5:59 am In World of Illusion on Genesis/MD, I think it's using the Shadow/Hilight feature of the vdp to achieve that effect
This site does a very nice job of explaining how the silhouette effect is achieved on Genesis:

https://rasterscroll.com/mdgraphics/gra ... ilhouette/
SNES AYE
Posts: 323
Joined: Mon Nov 07, 2022 11:28 am

Re: How is this Predator-style effect achieved?

Post by SNES AYE »

creaothceann wrote: Fri May 09, 2025 7:14 am
SNES AYE wrote: Fri May 09, 2025 4:13 am Edit: Also, I've always thought this silhouette effect was very nice in World of Illusion:

https://youtu.be/pcVO7TZ9yzM?t=1883

And now I expect it might be possible to achieve something similar on SNES using the same method as that NinjaWarriors boss, which would be cool to see used in some way. Does it look to you like that SNES subscreen exploit might indeed work for this kind of effect as well?
You could perhaps do something with a window.

- put the backgrounds and sprites on the mainscreen
- put a window at the same coordinates as the curtain (can even be wavy with HDMA)
- enable the window for mainscreen sprites
- set CGWSEL (MM bits) to black out the affected pixels

This will create black sprite pixels. Color math (with the fixed color) could then perhaps be used to add some color back, so that it appears gray.

(Not sure if the latest versions of SNES9x/ZSNES really don't support this?)
I’m thinking it might be possible to achieve this using BG3 as the gray silhouette with its shape matching the curtain. You’d have the two regular layers displaying as usual, and BG3 would act like the "duplicate" layer from the NinjaWarriors example. However, it would just be gray and only duplicate the curtain areas, rather than directly mirror all of another regular BG layer. Then, using the subscreen exploit, it would presumably display gray pixels only where the sprites overlap with BG3. Does that make sense? Could this approach work?
creaothceann
Posts: 787
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How is this Predator-style effect achieved?

Post by creaothceann »

Probably, but that reserves a whole layer that you could use for something else, e.g. the HUD.

EDIT: the implementation of the effect on the Genesis can be replicated on the SNES, since sprite vs. BG priority works similar. It just would needlessly use a lot of the sprites-per-line budget.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
SNES AYE
Posts: 323
Joined: Mon Nov 07, 2022 11:28 am

Re: How is this Predator-style effect achieved?

Post by SNES AYE »

creaothceann wrote: Fri May 09, 2025 10:00 am Probably, but that reserves a whole layer that you could use for something else, e.g. the HUD.

EDIT: the implementation of the effect on the Genesis can be replicated on the SNES, since sprite vs. BG priority works similar. It just would needlessly use a lot of the sprites-per-line budget.
On your first point, couldn't you split the background layer vertically? The top part could handle the HUD as usual, while the lower part uses the necessary scanlines for the curtain effect. I don't think they'd cross over at any time, or you could simply design a level so that when the effect is going to be used, there wouldn't be any vertical scrolling at that point to ensure this.

For your second point, if the curtain effect can be achieved using BG3 with subscreen techniques (or really just any of the layers depending on the setup), I presume that would mean you could avoid using sprites entirely for that part, other than the normal ones being used for the player and enemies. So, taking advantage of the SNES' extra BG layer here should free up the sprite budget for other elements. If feasible, going the extra BG route seems preferable in this particular case, especially since the SNES has tighter limits on sprite pixels per scanline but offers an additional background layer basically as standard (potentially two in Mode 0).

Does that sound reasonable?
creaothceann
Posts: 787
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How is this Predator-style effect achieved?

Post by creaothceann »

SNES AYE wrote: Fri May 09, 2025 11:01 am couldn't you split the background layer vertically? The top part could handle the HUD as usual, while the lower part uses the necessary scanlines for the curtain effect
Sure, but now you have to add more code to do the split - either via reserving and setting up a dedicated HDMA channel, or by setting up a vertical IRQ (PPU interrupts the CPU when it reaches a certain scanline) + IRQ handler. Whereas setting the fixed color is just writing a few values to a PPU register.

SNES AYE wrote: Fri May 09, 2025 11:01 am if the curtain effect can be achieved using BG3 with subscreen techniques (or really just any of the layers depending on the setup)
You don't have to use any background layer for the effect. Just use a window setting that turns the sprite pixels black, no color math needed (so the palette used by the sprites doesn't matter either).

SNES AYE wrote: Fri May 09, 2025 11:01 am that would mean you could avoid using sprites entirely for that part [...] should free up the sprite budget for other elements
Yes, that's the advantage that the SNES has over the Genesis in this case.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
SNES AYE
Posts: 323
Joined: Mon Nov 07, 2022 11:28 am

Re: How is this Predator-style effect achieved?

Post by SNES AYE »

creaothceann wrote: Fri May 09, 2025 11:38 am
SNES AYE wrote: Fri May 09, 2025 11:01 am couldn't you split the background layer vertically? The top part could handle the HUD as usual, while the lower part uses the necessary scanlines for the curtain effect
Sure, but now you have to add more code to do the split - either via reserving and setting up a dedicated HDMA channel, or by setting up a vertical IRQ (PPU interrupts the CPU when it reaches a certain scanline) + IRQ handler. Whereas setting the fixed color is just writing a few values to a PPU register.

SNES AYE wrote: Fri May 09, 2025 11:01 am if the curtain effect can be achieved using BG3 with subscreen techniques (or really just any of the layers depending on the setup)
You don't have to use any background layer for the effect. Just use a window setting that turns the sprite pixels black, no color math needed (so the palette used by the sprites doesn't matter either).

SNES AYE wrote: Fri May 09, 2025 11:01 am that would mean you could avoid using sprites entirely for that part [...] should free up the sprite budget for other elements
Yes, that's the advantage that the SNES has over the Genesis in this case.
That all sounds fair enough. So, if I've understood you correctly, it would make best sense to go with the window method you mentioned, the effect would look basically the same, and there would be no additional worries with layers or hitting sprite pixels per scanline limits, right? And this is for the silhouette effect.
creaothceann
Posts: 787
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How is this Predator-style effect achieved?

Post by creaothceann »

Yes.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
User avatar
dink
Posts: 234
Joined: Sun Jan 12, 2020 8:42 pm

Re: How is this Predator-style effect achieved?

Post by dink »

SNES AYE wrote: Fri May 09, 2025 8:05 am
dink wrote: Fri May 09, 2025 5:59 am In World of Illusion on Genesis/MD, I think it's using the Shadow/Hilight feature of the vdp to achieve that effect
This site does a very nice job of explaining how the silhouette effect is achieved on Genesis:

https://rasterscroll.com/mdgraphics/gra ... ilhouette/
Neat, thanks! :)
Post Reply