LoginLogin

Ultimate 'Mode7'

Root / Submissions / [.]

Autz64Created:
Version:Size:
Yet another 'Mode7' stuff, but now is different! This will allow you to have high-quality Mode7 witchery at very high framerate. This is archieved by using sprites to process a BG on a line-by-line scan, and modify every sprite (line) to archieve the effect we want. BE ADVISED THAT: 1.- Rotations on the Z axis are not a thing here, due to how it works. (so, making a racing stuff is quite complicated) 2.- Expect some slowdowns if you process too much lines. CHANGELOG: 12/04/2017 - Initial Release

Instructions:

To initialize it, you first need to setup the sprites that are going to be used for the Mode7:
LOAD "PRG1:UM7",FALSE

SPMIN=0   'The ID which the scan will begin
SPMAX=240 'The ID where the scan will stop

M7_SCAN SPMIN, SPMAX
Then, by using any algorithm you want, you have to modify the lines that you're going to use to create the effect you want. This, for example, will create a depth perspective similar to games like Mario Kart or F-Zero:
WDTH = 80

FOR I=SPMIN TO SPMAX
 Y=I
 M7_LINE I, 200, Y, -Y, I/WDTH, 1, 0, 0, 0, RGB(255,255,255)
NEXT
And this will create a wiggle effect:
WDTH = 80

A = (A+1) MOD 360

FOR I=SPMIN TO SPMAX
 Y=I
 M7_LINE I, 200+(SIN(RAD(A))*50), Y, -Y, 1, 1, 0, 0, 0, RGB(255,255,255)
 INC A
NEXT

YES! YES YES YES YES!

now what if you used regular mode 7 but instead of graphics you used bg so i could be textured?

Replying to:JohnCorby
now what if you used regular mode 7 but instead of graphics you used bg so i could be textured?
No. Because BG is more limited than plain sprites, which was the thing i was using here.