Hey all! I am trying to get a functionality where I can draw paths on a constantly scrolling background. Currently, I am drawing to an FBO, then drawing the FBO at a constantly moving “offset” according to the velocity of the object I am moving.
In the left case, all is as it should be—the drawing object is moving in the direction and the drawn path is constantly scrolling to the left to simulate motion (the drawing object stays in place).
On the right side is the problem. Because I’m drawing to an FBO, at a certain point I reach a horizontal limit, and my FBO becomes no longer visible. At this point I don’t really need the path drawn that’s offscreen to the left because this application will only be going to the right.
Does anyone know a simple solution to this? I’ve tried various things, like just making a huge FBO (runs into performance issues, of course) and even hot-swapping two different FBOs, but the problem with that is that the boundaries don’t transition properly when you are drawing in between the FBOs. I also tried just forgetting about the FBOs and storing the path history in a vector, but this runs into performance issues after a while too due to the drawing resolution.
What would be really nice is if there were a way to just constantly shift my FBO pixels to the left in a sort of queue fashion, loading new space to the right and deleting it to the left, but I haven’t been able to find a way to do this.
Any ideas or helpful knowledge is very much appreciated!