位移图悬停切换
WebGL Distortion Hover Effects (hover-effect),Robin Delaporte,2018 年

正在布展…
它是怎么做的
- 第 1 步两张图片和一张灰度位移贴图作为 uniform 传入
- 第 2 步progress 从 0 到 1 由悬停触发缓动
- 第 3 步第一张图按 位移值×progress 偏移 UV,第二张反向偏移
- 第 4 步按 progress 混合两张图
复刻配方
一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。
Create a full-quad ShaderMaterial with two image textures and a grayscale displacement texture. On hover, tween a progress uniform from 0 to 1 with an easing curve. In the fragment shader read the displacement value d, sample image A at uv offset by d*progress*intensity and image B at uv offset by -(1-progress)*d*intensity, then mix them by progress. Ship several displacement maps (stripes, clouds, cracks) so each card can have its own personality.


