# Animated texture using UVs

**URL:** <https://forum.babylonjs.com/t/animated-texture-using-uvs/34034>\
**Category:** Questions\
**Tags:** shader\
**Created:** [September 19, 2022, 8:47am UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034 "2022-09-19T08:47:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brainwilder](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@brainwilder](https://forum.babylonjs.com/u/brainwilder)\
**Post date:** [September 19, 2022, 8:47am UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/1 "2022-09-19T08:47:07Z")

</div>

Hello everyone,

I am trying to set a simple animated shader using UV offset, just like it can be done in Unity using texture offset (over time) or Panner node in Unreal Engine.

I am taking this example as a reference:

> **[Babylon.js Playground](https://playground.babylonjs.com/#1SLLOJ%2317)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

If I modify the code like this, can see the texture just moving through the mesh (this is exactly what I need)  
water.waveHeight = 0;  
water.bumpHeight = 1;

The problem is that I have set the whole scene using the baked lights from the 3D software, and this animated shader seems to require a babylon light to work.

Is there any way I can set this shader to a specific mesh without affecting the whole scene because of the need of Babylon lights?

Thanks!!!

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 19, 2022, 10:32am UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/2 "2022-09-19T10:32:33Z")

</div>

> [@brainwilder](#):
>
> and this animated shader seems to require a babylon light to work.

It seems to require or really requires it?  
Is it possible to see your shader?  
Is it possible to create the same effect without shader?

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [September 19, 2022, 11:34am UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/3 "2022-09-19T11:34:52Z")

</div>

What has this waterMaterial PG to do with your shader? Can you share your shader version?  
If your shader requires light to work, what about creating a node material (from scratch or from an existing base)?

---

<div class="post-metadata">

**Author:** ![brainwilder](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@brainwilder](https://forum.babylonjs.com/u/brainwilder)\
**Post date:** [September 19, 2022, 2:31pm UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/4 "2022-09-19T14:31:18Z")

</div>

Thanks for your answer, the thing is, I am really new to these Babylon aspects, I just dont know how to do this. Could you please help me? 🙂

---

<div class="post-metadata">

**Author:** ![brainwilder](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@brainwilder](https://forum.babylonjs.com/u/brainwilder)\
**Post date:** [September 19, 2022, 2:32pm UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/5 "2022-09-19T14:32:11Z")

</div>

I dont know how to achieve this, could you please give me some help? 🙂

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 19, 2022, 2:36pm UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/6 "2022-09-19T14:36:51Z")

</div>

Here is one of examples with animated textures - Lava Fun - [https://www.babylonjs-playground.com/#B6M2DD#2](https://www.babylonjs-playground.com/#B6M2DD#2)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [September 19, 2022, 3:41pm UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/7 "2022-09-19T15:41:13Z")

</div>

> [@brainwilder](#):
>
> I dont know how to achieve this

Do you mean [setting-up a playground](https://doc.babylonjs.com/toolsAndResources/tools/playground) or [creating a node material](https://doc.babylonjs.com/divingDeeper/materials/node_material) with the node material editor?  
@labris already gave you a base of a liquid animated type of node material. Here is [another one from the doc](https://playground.babylonjs.com/#9B0DNU#36) that could be relevant to you. The rest is basically knowledge about how nodes and materials work. I believe watching a video could help. You’ll find some pretty comprehensive ones on the bottom of the link I shared above.

For setting-up a PG, simply follow the instructions in the doc.

Once you have either set-up a PG or the base of node material in the NME, you can share that snippet with us along with your questions/problems and, of course, we’ll try to help (if we can) 😉  
Meanwhile, have a great day 🕶

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 19, 2022, 4:23pm UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/8 "2022-09-19T16:23:10Z")

</div>

> [@mawa](#):
>
> @labris already gave you a base of a liquid animated type of node material.

My example is even simpler, there is no Node material, just usual textures.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 19, 2022, 5:08pm UTC](https://forum.babylonjs.com/t/animated-texture-using-uvs/34034/9 "2022-09-19T17:08:51Z")

</div>

Here is another nice example - [https://playground.babylonjs.com/#27Y5SJ#4](https://playground.babylonjs.com/#27Y5SJ#4) from this thread - [Texture UV animation is very slow](https://forum.babylonjs.com/t/texture-uv-animation-is-very-slow/33902)
