Two simultaneous mode 7 textures?

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.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

Mode 7 is, by far, the most complicated thing to program well.

Zooming in and out is very easy

but perspective views with arbitrary rotation is amazingly complex.

The standard way of doing sky is to use mode 1 for half the screen, mode 7 for the floor.

Since you are planning a flying, horizontal scrolling, shoot em up... maybe you could forget all the mode 7 stuff except for some intro cut scenes or a boss fight where the boss is a mode 7 background that zooms, stretches, rotates.

The title screen to Super Metroid is M7, where it starts zoomed in and then zooms out. Those kind of subtle uses of M7 are what you should consider.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
kulor
Posts: 33
Joined: Thu Mar 15, 2018 12:49 pm

Re: Two simultaenous mode 7 textures?

Post by kulor »

iNCEPTIONAL wrote: Wed Aug 03, 2022 1:24 am *Certainly, there's more than enough tiles and colours in the tilemap for any artist to draw the background with those two things on it. I think it's like a 128x128 tilemap for Mode 7 backgrounds, right, so half or less than half for each part--and it really can be as small as needed as far as I'm concerned, so long as the end result looks like a decent sky and a decent ground texture
Something worth keeping in mind if you're talking about splitting a mode 7 map is, your mode 7 plane can't really be thought of as like a quad with arbitrary UV coordinates. The plane draws your whole mode 7 tilemap no matter what you do, it's on you to make sure the right thing ends up on the screen at the right time. What that means is, normally you could have this massive mode 7 plane that just draws the entire tilemap repeating forever (the Nova previewer works like this), or you can have it draw the tilemap once and then repeat a single 8x8 tile outside of the range of the map forever (Super Mario Kart and Pilotwings do this), the hardware accommodates both options...but if you're splitting your tilemap into 2 different views, you can't do that anymore, you have to limit the view of each portion of the tilemap to a span no larger than 512 texels. Your planes will look more zoomed-in and will have a much closer horizon than in games like SMK or Pilotwings.
iNCEPTIONAL

Re: Two simultaenous mode 7 textures?

Post by iNCEPTIONAL »

kulor wrote: Wed Aug 03, 2022 7:41 am
iNCEPTIONAL wrote: Wed Aug 03, 2022 1:24 am *Certainly, there's more than enough tiles and colours in the tilemap for any artist to draw the background with those two things on it. I think it's like a 128x128 tilemap for Mode 7 backgrounds, right, so half or less than half for each part--and it really can be as small as needed as far as I'm concerned, so long as the end result looks like a decent sky and a decent ground texture
Something worth keeping in mind if you're talking about splitting a mode 7 map is, your mode 7 plane can't really be thought of as like a quad with arbitrary UV coordinates. The plane draws your whole mode 7 tilemap no matter what you do, it's on you to make sure the right thing ends up on the screen at the right time. What that means is, normally you could have this massive mode 7 plane that just draws the entire tilemap repeating forever (the Nova previewer works like this), or you can have it draw the tilemap once and then repeat a single 8x8 tile outside of the range of the map forever (Super Mario Kart and Pilotwings do this), the hardware accommodates both options...but if you're splitting your tilemap into 2 different views, you can't do that anymore, you have to limit the view of each portion of the tilemap to a span no larger than 512 texels. Your planes will look more zoomed-in and will have a much closer horizon than in games like SMK or Pilotwings.
So, if I did indeed split the single tilemap into two different views as you described, roughly how less deep would that have to be and look [as viewed through the eyes of someone just playing the game] than say the Mode 7 sky in the example I provided previously*, assuming the bottom half of the screen was also the ground done with part of the single Mode 7 tilemap too, like half as deep, 1/5th as deep, only a little less deep?

*This one:
https://youtu.be/VWClU1hk7iA?t=1367
DifferentHalves.png
DifferentHalves.png (57.72 KiB) Viewed 705 times
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Two simultaenous mode 7 textures?

Post by rainwarrior »

A texel is just what a pixel from the map looks like. It's comes out in the render as an oddly shaped rectangle.

Small texels in the distance are just single pixels. At the bottom of the frame they get large and are bigger grainy rectangles.

So, roughly speaking, if you try to fit two separate maps onto a single mode-7 tilemap, you cut your maximum viewing distance by 1/2, which effectively magnifies all the texels by 2x in each dimension (so really, 4x in size).

How "deep" it looks isn't really what changes. You can make a landscape look the same distance with half the pixels. What it really does is just cut the resolution of your tilemap in half, and because mode 7 is a "zooming" effect, you have to zoom in to 2x magnification to compensate for cutting your tilemap in half.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

One option nobody mentioned. Color math at the horizon to blur the far areas. Besides aesthetics, this would also slightly reduce the amount of tilemap visible, making it easier to do a split like this.

Let me see if I can find an example...
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

This is a bit extreme example, color math subtraction, for a dark horizon.

Demon's Crest
Attachments
20220803_125224.jpg
Last edited by dougeff on Wed Aug 03, 2022 10:02 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Two simultaenous mode 7 textures?

Post by iNCEPTIONAL »

dougeff wrote: Wed Aug 03, 2022 9:54 am This is a bit extreme example, color math subtraction, for a dark horizon.
This is one half Mode 7 (the ground) and the other half normal background tiles (the sky) though, right?

If not, it looks to be almost exactly what I'm after in principle, at least visually from the perspective of what the end player would see and how they would interpret it.
Last edited by iNCEPTIONAL on Wed Aug 03, 2022 10:04 am, edited 2 times in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

I think the clouds are probably Mode 1

This is just an example of a color math technique
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Two simultaenous mode 7 textures?

Post by iNCEPTIONAL »

dougeff wrote: Wed Aug 03, 2022 10:01 am I think the clouds are probably Mode 1

This is just an example of a color math technique
Cool, cool.

And, yeah, I took it for granted I'd be asking the programmer to be doing a little bit of colour math to sell the effect of depth and things getting a bit less contrasting and more desaturated going into the distance and so on (I've just forgotten the name for that in real life. . . .), since it's in that sky example in the video I posted (and indeed is very common when using Mode 7 like this), so I knew it would be possible. That's all the last X percent of polish stuff that I totally want to have, so the final game looks and feels like something high quality and actually commercially release worthy. I really appreciate seeing those little touches in the best SNES games.

Good to know it can also help reduce the load with the tilemap a bit too. :D
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

FF6 - color math addition at the horizon (sorry for the blurry image)

A little more subtle.
Attachments
20220803_131902.jpg
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Two simultaenous mode 7 textures?

Post by iNCEPTIONAL »

I'm going to ask about an example that's maybe just going too far now, but if I never ask and have people think about the possibilities on a technical level, then I'll never know.

How plausible is it [even if really pushing the limits of the console] that the SNES could do the sky/ground split we've discussed (so two visually different elements sharing the one Mode 7 tilemap, with the necessary reduced draw distance and bigger texels), while also having a little bit of undulation on the ground as seen in this rather nice Mode 7 example:

https://youtu.be/3tYE1Gjizk8?t=866

Or even this one, where no rotation is used (I could totally live with that in certain scenarios), but the undulation effect and quality of the art in the tilemap makes it almost look like an early texture-mapped 3D Saturn/PlayStation game imo:

https://youtu.be/sRBX2GbGr2M?t=152
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

I think that ideas like this will guarantee that your project will never get completed.

Can it be done? Yes. If you hire a team of top level programmers to work round the clock for a year. It can be done. Sure.

But, no offense, if such a team existed, they would probably go off on their own and make their own game, separate from your game.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Two simultaenous mode 7 textures?

Post by iNCEPTIONAL »

dougeff wrote: Wed Aug 03, 2022 11:06 am I think that ideas like this will guarantee that your project will never get completed.

Can it be done? Yes. If you hire a team of top level programmers to work round the clock for a year. It can be done. Sure.

But, no offense, if such a team existed, they would probably go off on their own and make their own game, separate from your game.
Quite possibly true, on all fronts. Although that's something I can worry about.

The feedback in the relation to the question is greatly appreciated though.
iNCEPTIONAL

Re: Two simultaenous mode 7 textures?

Post by iNCEPTIONAL »

So, would this be an example of that split Mode 7 tilemap in action then: https://youtu.be/KHf1_Pk5pqU?t=744
Last edited by iNCEPTIONAL on Wed Aug 03, 2022 11:42 am, edited 1 time in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Two simultaenous mode 7 textures?

Post by dougeff »

Definitely yes. Good find.
nesdoug.com -- blog/tutorial on programming for the NES
Post Reply