List of techniques to fake 3D graphics with 2D hardware

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
List of techniques to fake 3D graphics with 2D hardware
by on (#186023)
So many games comes with various tricks to do 3D effects on 2D hardware that I don't know whether the amount of tricks possible is finite or infinite. Could such an exhaustive list be made ? Or is the number of technique just too long for that to be possible ?

Pre-rendering something that looks 3D is a special case so it would be just once part of the list.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186024)
It isn't an answer to your question but there are two examples of 3d effects in the High hopes Demo which I think are really good (I am sure everyone knows them already!). The first is the rotating rectangular cube. I have no idea at all how this is done.

https://youtu.be/eQ-OcS2Gwvk?t=56

The other one I like a lot is the blitter object towards the end.

https://youtu.be/eQ-OcS2Gwvk?t=105

Which I kind of vaguely am trying to replicate in a super simple way but haven't got very far yet.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186039)
The rotating cube at 0:56 is a mix of the vertical stretching used in Rad Racer and the CHR ROM-based texture mapping used in Cosmic Epsilon: each texture is stored at each width, and then for each scanline, timed code changes the Y scroll position to bring the appropriate row of the texture into view. This vertical stretching works on an NES but would have to be done all in software on a Master System.

The rotating dots at 1:45 are just a 3D transformation applied to each vertex. A couple tricks are possible: using orthographic projection so as not to have to divide by Z, and interpolation of frames so as not to need to perform the full transformation on all points each frame.

The Kefrens ribbons at 2:15 are two adjacent columns of the nametable rewritten during hblank, then a scroll change to reset the scroll to the top of the screen.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186059)
tepples wrote:
The rotating dots at 1:45 are just a 3D transformation applied to each vertex. A couple tricks are possible: using orthographic projection so as not to have to divide by Z, and interpolation of frames so as not to need to perform the full transformation on all points each frame.

…but rendered how? Sprites seem like there would be too many for some rotations ("seem"), and there's too much text for IT to be sprites.

But, the bright text also makes it easier for sprites to be seamlessly dropped when that situation would arise…
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186061)
I imagine the frontmost ones are drawn larger so that you'll not notice dropout of the rearmost ones. Plus as they rotate, few are horizontally aligned.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186139)
All I can think of is parallax scrolling: https://youtu.be/ltuRuGM271Q
And 3D effect in games such as 3D World Runner and Space Harrier. Is there a name for it?
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186177)
I don't know if there's a name for the specific 3D effect in WorldRunner...
There is per-scanline scaled graphics for perspective, and horizontal scrolling per scanline is used to make the perspective and parallax work correctly.
The same effect is also used by Street Fighter II and Toy Story, though on just a single plane in the front background.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186179)
"Pole Position effect"?
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186180)
Raycasting is another technique.

The problem with creating a list of techniques is that many of them don't even have names, or are not implemented consistently across different games.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186183)
I'd argue raycasting is kinda right at the end of 'fake' and the beginning of 'implement'.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186184)
I guess... Even though it's a bunch of tricks, the trig used does create a limited but mostly correct representation of the 3D space. Objects in raycasters are usually pretty fake though.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186186)
tokumaru wrote:
The problem with creating a list of techniques is that many of them don't even have names, or are not implemented consistently across different games.

The thread that was started just a little bit before this one made a pretty nice "visual" list, at least for the NES:
https://forums.nesdev.com/viewtopic.php?f=21&t=15338


Outside the NES...

Systems that can do lots of sprite coverage, and especially ones with sprite scaling (e.g. Sega's series of games like Afterburner, Space Harrier, etc.) can do quite a lot of 3D positioning of sprites. Like, that's basically the same as "real" 3D stuff except your drawing primitive is a sprite at a point, instead of rasterized triangles. (Point sprites are also a type of primitive on modern 3D hardware, BTW, mostly used for particle explosions and stuff.)

You could probably make a big category just for SNES techniques owing to Mode 7 or other stuff that's specific to it. It had pretty good sprite coverage too, so it could do some of the point sprite 3D techniques.


There's also a bunch of demoscene stuff. Rubber-cube via raster effects, copper bars, infinite bobs, etc. but a lot of these are of pretty limited/specific application.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186188)
Reminds me that the bar for '3d' was an oft-moving set of goalposts, at least on PC (consider Catacombs3D ~ Wolf3D < D°°M ≤ Duke3D < Quake/Descent)

Going behind stuff [>1 play layer] (Super Mario Bros. 3)
Parallax scrolling (too many to note, see topic)
raster effects, (pre?)scaled-sprites (Pole Position, Rad Racer)

Isometric and cavalier projections (Solstice, Snake Rattle 'n' Roll, Ultima VII) [much easier to do when you design levels where you cannot go behind terrain, or have loads of overdraw to play with]
Pre-rendered stuff that was CGI (DKC) or motion-captured (Mortal Kombat)
--or just pre-rendered, [u]animated[/i] scenes (Myst)
2d gameplay with rendered BG elements that got to act on Z-axis "2.5d" (Mischief Makers, Kirby 64, Tomba…and some bits of Yoshi's Island)
Pre-drawn rotations, scalings (Wing Commander)
…plus Mode 7 (Super Mario Kart)
…plus raycasting for terrain (Catacombs 3D, Wolf3D)
Rendered polygons mixed with sprites (Tomba…and some bits of Yoshi's Island)
Doom engine
==3d goalpost-moving stopped here, usually==
rendered wireframes, no polygons (Red Alarm)
Rendered polygons (Star Fox, Vortex, Stunt Race FX)
Texture-mapping
various light-shading methods
Dynamic lighting
etc.

Mono-stereo-surround sound shouldn't be entirely discounted either, and there are/were a fair few entries trying to bridge stereo and surround.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186192)
rainwarrior wrote:
There's also a bunch of demoscene stuff. Rubber-cube via raster effects


Rubber cube is not just simple raster-scrolling, but showing several previous frames of the rotating cube at different scanlines.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186207)
tokumaru wrote:
Objects in raycasters are usually pretty fake though.

But no more so than the coins and trees in Super Mario 64. A raycaster like Id Tech 0 in Wolfenstein 3D produces a 1-pixel-tall Z buffer, against which scaled sprites near each ray are rendered back to front. A portal caster like Build in Duke Nukem 3D works similarly, drawing sprites that are in or near each rendered room.

Where does stereoscopy (red-blue anaglyph, alternate frame, polarized) fit into the ranking of goalposts?
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186209)
Because it never really took off most of the times it's come up (3DS perhaps excepted?) it's kinda orthogonal. It might have sort of been a branch as "enhance your 3d experience" or "experience real 3d", but it died on its own rather than being superseded. Of course, I'm basing this on memories of gaming magazine article recollections of decades ago, so…take with salt.

Quote:
But no more so than the coins and trees in Super Mario 64.
I was tempted to say that it wasn't until PS2/GC era that the bar stopped moving (…on console) exactly because of this consideration.

[hr]

On another note, there's stuff like the iconic Amigaball…and, when we're considering mode7 w/sprites level, one should recall A2600 Solaris because it's a tech marvel.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186212)
tepples wrote:
But no more so than the coins and trees in Super Mario 64.

And it looked just as bad there too. How that game runs at only 30fps amazes me.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186392)
Well, I imagine they were using an early version of the bog-standard Fast3D microcode, and they claimed the game used ~60% of the system's power. I bet with an optimized microcode they could have locked it at 60 fps without hurting the graphical complexity.

The billboarded objects in Super Mario 64 didn't look bad at the time IMO (and nobody was complaining that I can recall - general consensus was that the game looked amazing). Also, I'm not specifically accusing you of anything, but playing in emulation makes that stuff look worse because of the resolution mismatch. The same thing happens in Mario Kart 64, in which the racers and weapons look awful pasted into a high-resolution 3D scene, even though they look perfectly serviceable on a real N64.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186394)
Espozo wrote:
tepples wrote:
But no more so than the coins and trees in Super Mario 64.

And it looked just as bad there too. How that game runs at only 30fps amazes me.

I take it you're not familiar with that generation?
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186762)
Oh dear me, I started the thread and didn't even take the time to say what I had to say 'case I was too busy.
So my theory so far was in the likes of the following :

3d operations consists of translation among 3 axises and rotation among 3 axises. 3d graphics consists of games having 2d action in a 3d environment, or a 3d action in a 2d environment, or both (3d action in a 3d environment), but the later is less suited for fake-3d style graphics obviously.

Translation among the X and Y axises are trivial to fake on 2D hardware because it's simply scrolling
Translation among Z axis is equivalent to scaling, only supported by some hardware (mode 7, GBA sprites), and is also easy to pre-render (or even real-time render like a demo by tepples)

Rotation among X and Y axis is very difficult to fake, yet it seems High Hopes managed to do so for the X axis only using some trick so it's possible
Rotation among the Z axis is equivalent to 2D rotation, this is supported by some hardware (mode 7, GBA sprites) and is also easy to pre-render

Now it's possible to combine pre-rendering with other real-time technique to get a 3d feel. Having isometric-graphic is a particular case of pre-rendering that allows for higher re-utilisation of backgrounds, making it possible to semi-pre-render large BG screens.

Parallax scrolling is just a particular case of translation (scrolling) different objects so they have different speed.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186763)
tomaitheous wrote:
Espozo wrote:
tepples wrote:
But no more so than the coins and trees in Super Mario 64.

And it looked just as bad there too. How that game runs at only 30fps amazes me.

I take it you're not familiar with that generation?

Even for the N64, the geometry in that game is very simple. Almost no games from the period were 60fps, but I'm saying if you took the engine used in Conker's Bad Fur Day and underutilized it to look like Super Mario 64, I wouldn't be surprised if the game were running at 60fps. Of course, We're talking about a game made in 1996 vs. 2001... It's really about the terrible Fast3D microcode, like 93143 was saying and how it wasn't until later people made their own. The N64 is a lot more powerful than the PS1, but judging by the majority of games, you wouldn't think so.
Re: List of techniques to fake 3D graphics with 2D hardware
by on (#186807)
We clearly need new N64 homebrew then ;)

Retrostage just did a run of a couple hundred N64 carts, so it's not far when you can get them made too.