# Example for parallax background with shader

**URL:** <https://forum.defold.com/t/example-for-parallax-background-with-shader/55981>\
**Category:** The Defoldmine\
**Created:** [June 25, 2019, 10:00pm UTC](https://forum.defold.com/t/example-for-parallax-background-with-shader/55981 "2019-06-25T22:00:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeZvers](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/nezvers/32/16030_2.png) [@NeZvers](https://forum.defold.com/u/NeZvers)\
**Post date:** [June 25, 2019, 10:00pm UTC](https://forum.defold.com/t/example-for-parallax-background-with-shader/55981/1 "2019-06-25T22:00:21Z")

</div>

Thanks to @Pkeod initial shader I put together a neat example for parallax scrolling background with shader and thanks to input from @Mathias_Westerdahl, the background doesn’t have to be a power of 2.  
Get it [HERE](https://github.com/nezvers/DefoldPublicExamples/tree/master/TilingShader).

P.S. There’s plenty of comments for parallax layer script and I still don’t understand how to set up a camera (this one projects more than it should and the picture is vertically squeezed).

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [June 25, 2019, 10:31pm UTC](https://forum.defold.com/t/example-for-parallax-background-with-shader/55981/2 "2019-06-25T22:31:14Z")

</div>

Good job!

---

<div class="post-metadata">

**Author:** ![IOD](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/iod/32/20576_2.png) [@IOD](https://forum.defold.com/u/IOD)\
**Post date:** [May 22, 2020, 2:18pm UTC](https://forum.defold.com/t/example-for-parallax-background-with-shader/55981/3 "2020-05-22T14:18:27Z")

</div>

Thank you  
Created pull request with offset resetting  
Big offset value caused artifacts on android 👾
