How can the SNES background be distorted without mode 7?

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
FeeeshMeister
Posts: 3
Joined: Sat Dec 01, 2018 6:02 pm

How can the SNES background be distorted without mode 7?

Post by FeeeshMeister »

I was curious earlier how the battle backgrounds in Earthbound work. I had always assumed that they relied on some kind of Mode 7 effect, but (if I'm not mistaken) Mode 7 uses the BG1 layer, but by disabling the backgrounds one at a time in Snes9x, the battle backgrounds seem to be in the BG3 layer. I had always thought it was impossible to do transformations on backgrounds (except for scrolling, of course) unless Mode 7 was enabled. Does anyone have any insight into how this effect could have been achieved? I am wondering specifically about the sinusoidal shifting and scaling of the background, and have been trying to recreate it.

For those who do not know what I am talking about, here are some examples of battle backgrounds from Earthbound.

https://www.youtube.com/watch?v=nomLvfvtAWE
https://www.youtube.com/watch?v=KpmyQUA ... 0s&index=8
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How can the SNES background be distorted without mode 7?

Post by tepples »

>Earthbound / Mother 2: Battle Against Frank Background
HDMA to the background horizontal scroll registers.

>Earthbound / Mother 2: Battle Against Bionic Krakken Background
HDMA to the background horizontal and vertical scroll registers.

Neither of these is substantially more complex than the backgrounds in Recca or Isolated Warrior or Super Spy Hunter for Famicom/NES.
niconii
Posts: 219
Joined: Sun Mar 27, 2016 7:56 pm

Re: How can the SNES background be distorted without mode 7?

Post by niconii »

Like a lot of effects on the SNES, this sort of thing can be done by changing parameters (such as scrolling, colors, etc.) while the screen is being drawn.

For instance, for the sinusoidal effect, between each scanline (row of pixels) of the screen being displayed on the TV, the background layer is scrolled to the left and right in a sinusoidal pattern. The result is that the background appears to be distorted on-screen.

Even the effect Mode 7 is most famous for (3D perspective) is only possible by doing things like this. Mode 7 on its own can only zoom a single background layer in and out, rotate it, and skew it, so it can't do a perspective effect all by itself. To achieve the effect, the background is zoomed in a little bit more each scanline, so that things near the top of the screen appear small, and things near the bottom of the screen appear large.
FeeeshMeister
Posts: 3
Joined: Sat Dec 01, 2018 6:02 pm

Re: How can the SNES background be distorted without mode 7?

Post by FeeeshMeister »

That is very interesting! I had actually considered that as a possibility while I was awy from my computer.
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How can the SNES background be distorted without mode 7?

Post by creaothceann »

Nicole wrote:Like a lot of effects on the SNES, this sort of thing can be done by changing parameters (such as scrolling, colors, etc.) while the screen is being drawn.

For instance, for the sinusoidal effect, between each scanline (row of pixels) of the screen being displayed on the TV, the background layer is scrolled to the left and right in a sinusoidal pattern. The result is that the background appears to be distorted on-screen.

Even the effect Mode 7 is most famous for (3D perspective) is only possible by doing things like this. Mode 7 on its own can only zoom a single background layer in and out, rotate it, and skew it, so it can't do a perspective effect all by itself. To achieve the effect, the background is zoomed in a little bit more each scanline, so that things near the top of the screen appear small, and things near the bottom of the screen appear large.
Visualization. Castlevania also uses Mode7 here for a neat effect.

3D effects can be created with all "normal" background modes by changing the vertical scrolling registers (Axelay), or both horz. and vert. registers (DKC2).
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: How can the SNES background be distorted without mode 7?

Post by 93143 »

One more thing you can do to distort backgrounds is offset-per-tile. In Modes 2, 4, and 6, you can repurpose an unused tilemap as a column scroll table, whereby each column of 8x8 tiles can have its own vertical scroll offset (at least, that seems to be the most useful aspect of offset-per-tile). In addition to wavy effects like in Yoshi's Island (in that case the foreground is column scroll while the background is HDMA scroll), you can combine it with HDMA scroll on one layer to produce a moderate amount of decently convincing rotation. Star Fox does this with its backdrops. The Mega Drive can do both line and column scroll too, but its column scroll table is smaller and can only do columns 16 pixels wide rather than 8 pixels. Batman and Robin uses a similar technique to Star Fox.

Using Mode 7 is a bit restrictive because you only get the one BG layer, so anything that has to share scanlines with the transformed Mode 7 image has to be made out of sprites. Technically you can get a BG2 in Mode 7, but it literally just reuses the BG1 VRAM fetch for each dot, so you can't do independent scrolling or transforms or anything; it mostly just lets you do per-pixel priority relative to sprites.
Post Reply