How can I create and apply SuperNES-esque affine Transformations into my project?

I’ve recently begun work for a Racing game, with retro aspects from SNES titles like F-Zero and Super Mario Kart; both of which use the platforms’ Mode 7. Now what I’m wanting to achieve is an effect that mimics the pseudo realism those games to create a desired appearance.

The basic premise of how Mode 7 works is that Planar texture maps using Mode 7 graphics are generated by transforming screen coordinates to background coordinates using a 2D affine transformation, which can any combination of translation, scaling, reflection, rotation, and shearing. Sadly, I was never able to take any geometry class back in high school, and even then any knowledge I do have is limited at best. Now I have skimmed over some topic on how to implement Mode 7 using affine transformations into GBA emulator from what I’ve seen, and I highly recommend you check it out before you post me your answers or any advice.

Tonc: Mode 7

Of course it’s not just the math that’s my problem, it’s translating that data into code that worries me. I’ll admit, I’m a bit of a newbie when it comes to Unity3d or making games in general. I’ve taken tutorials like the roll a ball lesson, and the Space shooter thing of course. The one thing I struggle with is the code. on top of that, I use notepad++, which will saves a lot of space on my computer, isn’t well versed with the unity keywords. Now I know there was a way to add hints for function parameters and enable highlights for unity keywords into notepad++ using versions that came prior to patch 4.3, but if you know or learn of way to just that for version 5.5 and so forth, than please let me know.

In conclusion, Do you think my question is valid in anyway? are there other ways of making my Racer look good? what sort of code should I use for my objects, backgrounds, and so forth? Please let me know as soon as possible.

Mode 7 is a very clever way of getting an affine and perspective correct texture projection … which is almost entirely pointless to reimplement on modern graphics engines and GPUs. Just take a texture, turn off mip maps, uncompressed, filtering to point, use an unlit shader, put it on a plane, and angle your camera slightly down. There you go, perfectly replicated.

Unless you’re looking to exactly emulate the original hardware limitations and enjoy the machinations of writing all of that code yourself, there’s not a reason to.

The only step left to replicate the Mode 7 look is to put some sprites or vertical plane in the distance for the fake, slightly too low, horizon line.

3 Likes

Thanks for the advice, I’ll see if it works out the way I hoped it would. Also, do you happen to have any knowledge on achieving a effect similar to paralax scrolling?

Google has the answer your looking for. :wink:

1 Like