Max Overlapping Layers

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.
iNCEPTIONAL

Re: Max Overlapping Layers

Post by iNCEPTIONAL »

OK, cool. Thanks for showing that.

So, this is one of those examples, where, if I was using Mode 0 and just really wanted to have BG3 in front of BG1 for some reason, I could instead use the hack that LMPunny employed in my Mode 0 test's bridge level to similarly make BG3 appear in front of BG2 by [according to him] putting some parts of the layers on the Main-screen and parts on the Sub-screen [without doing any obviously-visible semi-transparency effects or versions/variations of high-res] to effectively arrange them in a way that normally wouldn't be the case (the effect was to move the cars that were on BG3 on top of the road that was on BG2, which, although technically wasn't necessary anyway, and could have been done by me simply rearranging the layers myself more effectively in the first place, it still showed me something that isn't normally talked about as being possible with the layers on SNES).

LMPunny's test:
Mode0Bridge.zip
(583.63 KiB) Downloaded 22 times
Press "D" a few times to skip to the actual level.

I'm actually curious as to how using his hack on top of everything else might potentially allow me to increase the perceived overlapping layers even further than demonstrated in your Mode 0 example above if used effectively. I haven't thought about it beyond that, but given how LMPunny used it in my level, I have to imagine there's some cool ways it could be used in the right hands.
Last edited by iNCEPTIONAL on Thu Jul 21, 2022 6:41 am, edited 2 times in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Max Overlapping Layers

Post by dougeff »

Mode 0 and just really wanted to have BG3 in front of BG1
LMPunny employed in my Mode 0 test's bridge level
I can't find a link to that, but from the YouTube videos and this description
the cars (layer 3) for their scanlines are in mainscreen, and the road (layer 2) is in subscreen.
it seems to me that the sub screen looks BEHIND some layers on the main screen, maybe (I'm speculating) because he turned off some main screen layers and told color math not to affect layer 3...and the backdrop color is probably black. I don't know.

Using the sub screen (color math) would also mean you can't do any other color math effects at the same time, so I don't like that idea.

But, I suppose, there's nothing here that couldn't have been done with just normal layering on the main screen.

Yes, you could have layer 3 or 4 be on top of layer 1 again, by turning off layer 1 (or just having nothing on layer 1 at that part of the screen) but it wouldn't look OVERLAPPED. You'd have to fake the overlap with sprites.

So, the answer is yes. If 13 layers is not enough for you, you could double it by squeezing this demo into half the vertical space, duplicating it again at the bottom, and using the highest priority sprites fake any visual overlap to make layer 4 appear in front of layer 1.

In my opinion, my Mode 0 Demo is already very busy... the entire screen is filled with overlapping objects. If you put proper parallax on it by adjusting the horizontal scrolling of each layer with HDMA, it should be enough for your purposes.
Last edited by dougeff on Thu Jul 21, 2022 6:51 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Max Overlapping Layers

Post by iNCEPTIONAL »

dougeff wrote: Thu Jul 21, 2022 6:19 am
Mode 0 and just really wanted to have BG3 in front of BG1
LMPunny employed in my Mode 0 test's bridge level
I can't find a link to that, but from the YouTube videos and this description
the cars (layer 3) for their scanlines are in mainscreen, and the road (layer 2) is in subscreen.
it seems to me that the sub screen looks BEHIND the sprites on the main screen, maybe (I'm speculating) because he turned off some main screen layers and told color math not to affect layer 3...and the backdrop color is probably black. I don't know.

Using the sub screen (color math) would also mean you can't do any other color math effects at the same time, so I don't like that idea.

But, I suppose, there's nothing here that couldn't have been done with just normal layering on the main screen.

Yes, you could have layer 3 or 4 be on top of layer 1 again, by turning off layer 1 (or just having nothing on layer 1 at that part of the screen) but it wouldn't look OVERLAPPED. You'd have to fake the overlap with sprites.

So, the answer is yes. If 13 layers is not enough for you, you could double it by squeezing this demo into half the vertical space, duplicating it again at the bottom, and using the highest priority sprites fake any visual overlap to make layer 4 appear in front of layer 1.

In my opinion, my Mode 0 Demo is already very busy... the entire screen is filled with overlapping objects. If you put proper parallax on it by adjusting the horizontal scrolling of each layer with HDMA, it should be enough for your purposes.
Here's LMPuny's test version:
Mode0Bridge.zip
(583.63 KiB) Downloaded 20 times
Press "D" a few times to skip to the actual level.

It's more than enough layers, but I'm obviously not going to limit myself too much at this early testing/prototyping stage (beyond obviously sticking within the actual hard limits that I'm aware of), so, if some additional potential use is there, I just want to make sure I understand how it can be used properly (at least as best as I can understand for now), and then I can decide if I really have to bother with using it going forward. Right now, I have no ideas for how I'd want or need to use it, but knowing it's even an option and having it there just in case is the value for me.
Last edited by iNCEPTIONAL on Thu Jul 21, 2022 6:44 am, edited 7 times in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Max Overlapping Layers

Post by dougeff »

Oh, and I forgot. We are close to running into the Sprite Limit, per scanline, so this exact demo wouldn't translate well to actual gameplay without reducing the number of sprites used.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Max Overlapping Layers

Post by iNCEPTIONAL »

dougeff wrote: Thu Jul 21, 2022 6:29 am Oh, and I forgot. We are close to running into the Sprite Limit, per scanline, so this exact demo wouldn't translate well to actual gameplay without reducing the number of sprites used.
Yeah, I personally wouldn't be doing it with sprites in the actual game--I have a whole high-action shmup I intend to populate with actual ships and bullets and other interactive level elements and so on--but it's cool to just to see how many overlapping layers can be done. And this is also why I'm trying to squeeze as much as possible out of all the backgrounds in Mode 0 alone first (and whatever other visual effects using window/masks and the like), before I even start to think about where to go with all the other actual gameplay stuff that's largely going to require as many sprites as possible too.
UnDisbeliever
Posts: 124
Joined: Mon Mar 02, 2015 1:11 am
Location: Australia (PAL)
Contact:

Re: Max Overlapping Layers

Post by UnDisbeliever »

Wonderful demo dougeff.

I especially like how easily it shows off the layer priorities and draw-order (compared to the priority lists in the wiki).
Post Reply