Flaming Mitten R&D - Mode7 investigation / Simulating oldskool raster effects
Sparkyidr
Member Posts: 2,033
Hey guys
I've started looking at approximating something looking like mode-7.
But first, I decided to see how easy it would be to simulate some raster effects
The floor on Street fighter 2, is basically an image what's wider than the screen. And they scrolled each raster line up the screen, slightly slower than the previous. This gives a cool 3d effect to the floor. It's like a really extreme parallax scroll....instead of having say 3 layers, foreground, back1 and back 2, each rasterline is a parallax layer
So I took some images (nicked the street fighter floor) at 6px high (I only took 480 wide though.and then put an actor every 6 px up the screen (I used 8). I set the speed to be the a set amount - the y value. So each actor above is slightly slower than the last.
I then set the image dependant on the Y value using the 8 images I took from the floor image.
Check out the following video...might not look all that interesting, but it's deffo working as it should (I didn't take wide enough images, so I only have a limited field of movement right now.
An interesting side note/bug
The 8 Y values should be :
3, 9, 15, 21, 27, 33, 39, 45
but to get them to line up, I had to set them to :
3, 9, 15, 20, 25, 31, 37, 43
for some reason!
I reckon 6 pixels is probably small enough as long as your initial image is wide enough for your needs. The firther you scroll from your initial centre point, the more jaggies you will get between the layers though. Ideally, you would use 1 pixel...but I fear performance would be a massive issue.
I've started looking at approximating something looking like mode-7.
But first, I decided to see how easy it would be to simulate some raster effects
The floor on Street fighter 2, is basically an image what's wider than the screen. And they scrolled each raster line up the screen, slightly slower than the previous. This gives a cool 3d effect to the floor. It's like a really extreme parallax scroll....instead of having say 3 layers, foreground, back1 and back 2, each rasterline is a parallax layer
So I took some images (nicked the street fighter floor) at 6px high (I only took 480 wide though.and then put an actor every 6 px up the screen (I used 8). I set the speed to be the a set amount - the y value. So each actor above is slightly slower than the last.
I then set the image dependant on the Y value using the 8 images I took from the floor image.
Check out the following video...might not look all that interesting, but it's deffo working as it should (I didn't take wide enough images, so I only have a limited field of movement right now.
An interesting side note/bug
The 8 Y values should be :
3, 9, 15, 21, 27, 33, 39, 45
but to get them to line up, I had to set them to :
3, 9, 15, 20, 25, 31, 37, 43
for some reason!
I reckon 6 pixels is probably small enough as long as your initial image is wide enough for your needs. The firther you scroll from your initial centre point, the more jaggies you will get between the layers though. Ideally, you would use 1 pixel...but I fear performance would be a massive issue.
Comments
Just depends on how having 8 or so actors per platform will kill the performance.
can someone help?
But basically, as the floor scrolls left to right, the front scrolls faster than the back, with varying speeds in between.
It gives a very subtle 3d (2.5d) effect.
On an 8 or 16 bit computer/console, you could do this per raster line (1 pixel) using bitmap manipulation
But in GS, you can't do that.
What you have to do is.
1. Have an image that's a lot wider than the scene/object (this is the same as the oldskool way of doing it too)
2. Split the image into sections from front to back. The bigger the hight of the sections, the chunkier and more jaggy the effect will look. (Ideally, you would make each section 1px high.
3. Re build the image in GS, but using actors for the sections.
4. Apply rules so that each section moves slightly slower the further up the screen (and hence further back in the fake z axis) it is.
you can see a more extreme use of the technique in my 8bit 3d road video :
That's using the same segmenting technique as I mentioned above, but rather than just scrolling at a slower speed further back into the z axis (fake z axis remember, as we are not in true 3d) I am applying a "SIN" function to the segments so that depending on where they are in the Y axis onscreen, they will move to form a curve when I create a left or right hand bend function.
Basically........it's a very complex way to make something that was fairly simple to do 20 years ago, in an engine that wasn't really designed to do that sort of thing.
Basically 2...I am a geek ;o)
Good work there.
Interesting that later SF games actually abandoned paralax floors?
until now everything is polygon.
Tatsunoko vs Capcom - GREAT!
Darren.
I've also uploaded the Pseudo 3D template to incude this..as well as the 3d road corners stuff.
http://gamesalad.com/forums/topic.php?id=16974
)