How do you use a scrolling 2D background for a 3D game?

I’ve recently considered trying to make a retro style 3D game in Unity. I noticed that a fair amount of 3D games from the N64/Saturn/PS1 era tended to use looped scrolling images for their background scenery rather than a textured skybox mesh (i.e. the backgrounds in games like Super Mario 64 or Sonic R). Whenever the camera would turn horizontally the background would scroll horizontally, and when it tilted up or down the background would scroll up or down. I’ve been searching all over for some kind of info on this, but I can’t seem to find any. Could someone explain to me how something like this could be done in Unity?

Best examples I could find for what I’m talking about (focus on the backgrounds and how they move with the camera):

Have you thought about using a 3D spherical or cube-mapped texture? Environment mapping.

Did some research on cubemaps and that might be exactly what I’m looking for. They appear to only be affected by camera rotation rather than translation and they have no visible seams or faces, kinda like old 3d game backgrounds. Thanks for that information.

yes that’s it. and it might be interesting if your cubemap is transparent and you have a skybox for very distant background.
8871999--1211385--skybox.jpg

A cube map would be the correct way of rendering sky but it’s different from the scrolling background effect that you showed above because it involves some distortion. A cube map would look a little bit like this doom background just less exaggerated.

So if you want the original non-physically correct scrolling background, I would try to write my own skybox shader which simply uses the camera yaw and pitch as offset when sampling the background texture (with a wrap/repeat sampler).

You can change the skybox material so it should be possible to replace it with your own shader - I haven’t tried it though. You can extract yaw and pitch from UNITY_MATRIX_V like this.