This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I plan to use a parallax background, and to make it scroll infinitely, it will increase the size of the textures (which will be imported with repeat), my question is because the game is an infinite scroller. If you have a 10,000 x 800 pixel sprite, for example, which is just one 1000 x 800 sprite being tiled over and over as the terrain scrolls, what is the impact on gpu and memory? Is there any cost to having all this texture "off screen"?

in Engine by (276 points)

1 Answer

0 votes
Best answer

Ideally, you wouldn't have vast amounts of off-screen textures just for infinite scrolling. A better approach would be to have just enough texture "chunks" to fill the screen with a little off-screen buffer at both ends. Then, when scrolling, as soon as one of the chunks has scrolled out of view (typically, off the left-edge of the screen), just move it to the end of set of textures (so, off of the right-hand edge of the screen). Just repeat this each time a chunk is no longer viewable.

That way, you just need enough chunks to fill the screen, plus a bit of buffer and you still get infinite scrolling...

Specifically to your question of "is there a cost to all the off screen textures"... While I'm sure the answer is Yes, I can't really quantify what that cost might be...

by (22,704 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.