classic vector 3D graphics as parallax background in 2D game

Hi!

I was thinking about a cool looking parallax scrolling background and the alien 1 nostromo landing computer came into my mind.
I want to make my game for mobile so I need an algorithm that calculates the graphic before it is drawn.
Is there a way to do this, maybe an asset ?

Thanks
Andy
5366991--542973--Bildschirmfoto 2020-01-08 um 22.13.42.png

What do you mean by “calculates”? Do want to do procedural geometry? Do you want to render your 3D grahpics to 2D background layers?

Yes exactly. The terrain in the background is not for a specific purpose. It should be generated randomly…
I managed to calculate 2 layers of background triangles so far, where my algorithm calculates the visibility of the 2nd, (more far away) triangles
https://www.youtube.com/watch?v=_r3KW9iJSBE
(I am not a mathematical genius haha). When the calculation is made, the points are send to the line renderer (fast line renderer in my case). This only costs exactly one draw call, independently of the amount of layers.
So I would like to use an algorithm where a complete terrain is calculated, like in the attached picture and where the individual layers can be animated using parallax scrolling.

There are 3 main problems to solve:

  1. How to generate an endless terrain only for the camera (it does not exist in the world, it is only an “illusion”)
  2. How to calculate the layers for visibility in a 2D (side view) perspective to be renderered with the line renderer.
  3. How to calculate the parallax scrolling dependencies for each individual layer of the generated terrain, so that the terrain will not “break” in the background because of the parallax scrolling.

It is not easy for me to articulate this perfectly, but in a 3d world, everything would happen automtically, but how to calculate all this?

The benefit would be
awesome graphics,
absolutely no resources necessary, no assets, no artist …
only ONE draw call, perfect for mobile
small build size, because no sprites needed for background.
…and …everybody loves classic vector graphics

the Mathf.PerlinNoise function might help because you can generate a repeatable sequence of terrain-ish points using world-space x for the x and some imaginary depth or layer number for the y.

Thanks for the suggestion. I already thought about this and I think ist would be a good solution to start with in terrain generating.