# Shader - UVs based on whole atlas?

**URL:** <https://forum.defold.com/t/shader-uvs-based-on-whole-atlas/6183>\
**Category:** Questions\
**Created:** [March 11, 2017, 12:44pm UTC](https://forum.defold.com/t/shader-uvs-based-on-whole-atlas/6183 "2017-03-11T12:44:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 13, 2017, 1:04pm UTC](https://forum.defold.com/t/shader-uvs-based-on-whole-atlas/6183/4 "2017-03-13T13:04:12Z")

</div>

There is a workaround you can do to get the “id” of each vertex, and thus implement your own uv coords.  
I posted an example [here](https://forum.defold.com/t/2d-light-implemetations/3636/5) which adds some shader constants to a sprite/shader, in particular, the center point of the sprite.  
With it you can determine the id [like this](https://github.com/JCash/defoldexamples/blob/master/main/visibility/box.vp).

---

_[View the full topic](https://forum.defold.com/t/shader-uvs-based-on-whole-atlas/6183)._
