So I'm making a little test project, in the hopes that it might be a small game some day. In this game, I want to have an asteroid field in the background, stretching off into the distance.
These objects will need varying parallax values of course, and will need to be layered appropriately.
So my first idea was to use multiple layers each with successively lower parallax values. My problem with this approach, is that spawning a few thousand asteroids randomly among all the right background layers is awkward. I need at least 15 layers to make things look right too and would prefer much more really.
Obviously, I needed more control over the parallax values. So I thought, I will just make my own parallax system.
So (roughly speaking) I take the motion of the camera, and multiply it by an object's parallax value, and then move the object in the opposite direction of the camera motion.
Once I got it working, this looked great. But... this means that very often, I'm moving potentially thousands of objects around. In my tests already, this seems to use an uncomfortable amount of resources for such an early stage in the game.
Does anyone have any ideas for how I can get more granular control over object parallax values without resorting to many layers each with separate parallax values.