Scrolling background

I'm looking to add a scrolling background to my top-down view space shooter, but I'm not sure how to do that. Would a SkyBox with a big texture on only one side work?



Also, it's a fairly large "world", so I doubt a single texture would work. I'm thinking I could make a huge background texture, then cut overlapping pieces out of that and swap textures on the SkyBox (or whatever I'm going to use) in the application when you move around the world.

Anyone have any better ideas? Sounds kinda wasteful to have a whole bunch of textures who share so much data between each other. heh

I think it's not a good idea to have a giant bitmap as level background, I would recommend to compose it from smaller things seen there.



But if you still want to show that big bitmap consider to split it into e.g. 512x512 bitmaps without overlapping. Then use quads and put them beneath each other like tiles. You could then load just the portion of the background that is currently visible. This though could result in some lagging as loading textures is rather slow as of the high amount of data…

Hmm, I guess one variant is if you could place a tiled star-texture on a big Quad, then place smaller Quads slightly infront of that with some random textures of planets, nebulas etc. I suppose that tiling can be accomplished by using the Geometry.setTextureCoord() method, though I really have no idea how that thing works.

Any help or resources to give some insight into that?



Edit: Ah, looked through the FurBallz code and found how to make textures tile. :slight_smile:

Glad FurBallz can be of use :slight_smile:

Curious tho, is there any significant performance hit with having one 5000x5000 quad compared to a few small ones that you move around depending on current view position?