How to render Parallax Background and Foreground Layers Completely in the Shader [Tutorial]
EDIT Oct 16 2014 : Changed precision to lowp for fragment shader. Consider using this as a default for mobile, unless you really need something better. I saw a 2x speed increase on Kindle by doing so. Hi all! Here's a quick little diddy for anyone curious on a quick way to get a layered effect in your 2D game (note: we are still using 3D vertices): I did a little more progress on Hoarder Monkey and I am happy to have parallax backgrounds working all in the shader and in 1 draw call per object type (static VBO, dynamic sprites, Semi-transparent VBO, semi-transparent sprites). :) The background scrolling is all handled in the shader, and works surprisingly well. I also do some color tweaking to make things a little darker in the foreground and blue-ish in the background: Notice the closest graphics are darker Notice the background objects are a more blue/white hue. In case your curious the shader code is pretty simple (as it should b...