Hi all! I’m using a shader to generate a background on which I’m placing some sprites. The background actually changes depending on the camera offset. The character sprite moves around and the camera follows the character. To accomplish this, I’m sending the camera scroll to the shader:
this.shader.setUniform("offset.value.x", this.cameras.main.scrollX);
this.shader.setUniform("offset.value.y", -this.cameras.main.scrollY);
This works, but the problem is that it is slightly delayed. If I’m moving back and forth rapidly, it appears like the sprites are floating/jittering on top of the background, because it has a slightly older camera scroll. Eventually it catches up, but while moving it looks weird.
Any ideas for how to fix this? Thanks!