# Dynamic Material based on uv coordinates

**URL:** <https://forum.babylonjs.com/t/dynamic-material-based-on-uv-coordinates/44486>\
**Category:** Questions\
**Tags:** material, shader, uv\
**Created:** [September 26, 2023, 3:05pm UTC](https://forum.babylonjs.com/t/dynamic-material-based-on-uv-coordinates/44486 "2023-09-26T15:05:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![shaderbytes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shaderbytes/32/174_2.png) [@shaderbytes](https://forum.babylonjs.com/u/shaderbytes)\
**Post date:** [September 27, 2023, 5:58pm UTC](https://forum.babylonjs.com/t/dynamic-material-based-on-uv-coordinates/44486/10 "2023-09-27T17:58:00Z")

</div>

> [@Evgeni\_Popov](#):
>
> But I don’t remember having a problem with the x coordinate?

Oh sorry , yes Patrick did explain this , i went and checked the thread i discussed it in :

> [@50% gray for bake source of tinted unlit shading](https://forum.babylonjs.com/t/50-gray-for-bake-source-of-tinted-unlit-shading/38114/12):
>
> Why the V when its the horizontal that is flipped? , I fixed it flipping the U ( x ) , eg : is this wrong?

TLDR , I incorrectly thought x flip worked , but it was not correct , it required y flip and rotating the camera 180. ( it does matter if you look in which corner the letters a,b,c,d etc are in each block of patricks example )

Ok so i had the wrong axis , sorry @Shirhix , but anyway an issue with unexpected behaviour is still at hand regardless of me getting the two axis muddled , inconsistent behaviour between NME and babylon engine outside of this, patrick did say talks were happening about how to iron this out : quote :

> [@50% gray for bake source of tinted unlit shading](https://forum.babylonjs.com/t/50-gray-for-bake-source-of-tinted-unlit-shading/38114/11):
>
> This has to do with NME not handling Texture.invertY in the same way as the engine. You can correct it with a negative scale on V for the texture and rotating the camera to the correct angle. The preview window is just another Babylon scene with an arcRotate camera set to a specific alpha and beta value. We have been talking about ways to make this more seamless, so improvements are coming.

---

_[View the full topic](https://forum.babylonjs.com/t/dynamic-material-based-on-uv-coordinates/44486)._
