# Is this a shader or a threejs animation type?

**URL:** <https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899>\
**Category:** Questions\
**Tags:** shaders\
**Created:** [July 2, 2022, 8:42am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899 "2022-07-02T08:42:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myth\_Xenodo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/myth_xenodo/32/27434_2.png) [@Myth\_Xenodo](https://discourse.threejs.org/u/Myth_Xenodo)\
**Post date:** [July 2, 2022, 8:42am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/1 "2022-07-02T08:42:08Z")

</div>

So I don’t know if this is somehow related to ThreeJS or not or just a shader…Can someone direct me where or what I learn this stuff cause I wanna do this kind of animation thing.

> **[Yuen Ye](https://yuenye.com/)**
>
> Portfolio of designer Athena Tian.

> **[SEMPAI](https://dwl.media/)**
>
> Ernesto Aguirre combines media and aesthetics to create visual solutions.

as you see the image looks like its bending when scrolling or just may animating itself the curvy picture style.  
Can anyone suggested me where can I learn this? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [July 2, 2022, 9:03am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/2 "2022-07-02T09:03:50Z")

</div>

You need cloth with wind?  
[https://raw.githack.com/looeee/three.js/bd67e75c805c0b261b8606e74a4d77ed8b336a7c/examples/webgl\_animation\_cloth.html](https://raw.githack.com/looeee/three.js/bd67e75c805c0b261b8606e74a4d77ed8b336a7c/examples/webgl_animation_cloth.html)

---

<div class="post-metadata">

**Author:** ![Myth\_Xenodo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/myth_xenodo/32/27434_2.png) [@Myth\_Xenodo](https://discourse.threejs.org/u/Myth_Xenodo)\
**Post date:** [July 2, 2022, 9:06am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/3 "2022-07-02T09:06:55Z")

</div>

not really somehow like this…Basically something like this but I don’t want to use react-three-fiber cause it feels like its not informational to me.

> **[ecstatic-albattani-htdud - CodeSandbox](https://codesandbox.io/s/tender-worker-sh76f?from-embed=&file=%2Fsrc%2Fblocks.js:470-507)**
>
> ecstatic-albattani-htdud by drcmda using lerp, react, react-dom, react-scripts, react-three-fiber, three

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [July 2, 2022, 9:18am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/4 "2022-07-02T09:18:39Z")

</div>

Understood. Bending+ texture zoom in-out.

---

<div class="post-metadata">

**Author:** ![Myth\_Xenodo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/myth_xenodo/32/27434_2.png) [@Myth\_Xenodo](https://discourse.threejs.org/u/Myth_Xenodo)\
**Post date:** [July 2, 2022, 9:21am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/5 "2022-07-02T09:21:46Z")

</div>

so what kind of lesson or where can I learn this stuff?

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [July 2, 2022, 9:29am UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/6 "2022-07-02T09:29:41Z")

</div>

While i think just need to use his shader code CustomMaterial.js

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/d/7d937433490b54a7f3a868330bc112fb56a4f4df.png)

---

<div class="post-metadata">

**Author:** ![alessandro\_guarino](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alessandro_guarino/32/16309_2.png) [@alessandro\_guarino](https://discourse.threejs.org/u/alessandro_guarino)\
**Post date:** [July 2, 2022, 12:04pm UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/7 "2022-07-02T12:04:28Z")

</div>

Hi @Myth_Xenodo

In my opinion, to have a similar effect, you need to separate the two problems:

1. detect scrolling
2. transform/animate/costumize your 3d elements based on your scrolling detection

Only the point two has threejs dependency… so first of all you need something like GSAP with scrollTrigger addon to detect scrolling, it’s not very heavy to apply, you just need to get some practice.

> **[ScrollTrigger](https://greensock.com/scrolltrigger/)**
>
> ScrollTrigger creates jaw-dropping scroll-based animations with minimal code. Or trigger anything scroll-related, even if it has nothing to do with animation.

There are others solutions too, but in my opinion GSAP is a good and all-in-one solution (tweening, scrolling, svg transformation and more …), it is used a lot in conjunction with threejs and you can find many code samples  
[codepen scrollTrigger gallery](https://codepen.io/collection/DkvGzg)

also in threejs conjunction  
[here a very good example from Steve Gardner](https://codepen.io/ste-vg/pen/GRooLza)  
In this example the render is performed only on the scrolling change, while in your examples the rendering is continuous (otherwise the veils do not flutter) but with the right changes you can do whatever you want.

I hope you find it useful as a starting point for your developments

---

<div class="post-metadata">

**Author:** ![Myth\_Xenodo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/myth_xenodo/32/27434_2.png) [@Myth\_Xenodo](https://discourse.threejs.org/u/Myth_Xenodo)\
**Post date:** [July 2, 2022, 12:29pm UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/8 "2022-07-02T12:29:53Z")

</div>

oh thanks I have already knowledge in gsap just a bit problem with shaders hahaha…

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [July 2, 2022, 4:23pm UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/9 "2022-07-02T16:23:08Z")

</div>

Done.  
https://codepen.io/illuminsi/embed/preview/PoRqKem?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=PoRqKem

---

<div class="post-metadata">

**Author:** ![joaogardenberg](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/joaogardenberg/32/27733_2.png) [@joaogardenberg](https://discourse.threejs.org/u/joaogardenberg)\
**Post date:** [July 3, 2022, 1:57pm UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/10 "2022-07-03T13:57:10Z")

</div>

From that example, it doesn’t look that you even need threejs to achieve that. You could do that with pure css/js

---

<div class="post-metadata">

**Author:** ![Myth\_Xenodo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/myth_xenodo/32/27434_2.png) [@Myth\_Xenodo](https://discourse.threejs.org/u/Myth_Xenodo)\
**Post date:** [July 3, 2022, 1:59pm UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/11 "2022-07-03T13:59:56Z")

</div>

that sound’s impossible to me…hahah give me a sample then. @joaogardenberg

---

<div class="post-metadata">

**Author:** ![joaogardenberg](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/joaogardenberg/32/27733_2.png) [@joaogardenberg](https://discourse.threejs.org/u/joaogardenberg)\
**Post date:** [July 3, 2022, 3:13pm UTC](https://discourse.threejs.org/t/is-this-a-shader-or-a-threejs-animation-type/39899/12 "2022-07-03T15:13:05Z")

</div>

You can achieve that with observing the scroll position and dynamically adding css properties to the elements:

- The images zooming in/out on scroll, you can achieve with [Zooming Background Images | CSS-Tricks - CSS-Tricks](https://css-tricks.com/zooming-background-images/)
- The background movement you achieve with css background-position
- The X rotation can be achieved with css transform

Btw, the response was about that comment of yours, and not the main one:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/a/9/a92f4ab777b1361ce7b60911739fec09ea368329.png)

As showed here:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/c/7cc028e8fc51dcad6e5d4dd11d92cf9c8e29291f.png)
