效果圖:
代碼及詳解:
代碼很簡單,讓我們直接來看代碼
varying vec2 texcoord;
// uniform float iGlobalTime;
// uniform vec2 iResolution;
#define PI 3.1415926f
#define PIx2 2.*PI
#define PI_HALF PI/2.
#iChannel0 "file://./yeah_0.jpg"
#iChannel1 "file://./yeah.jpg"
void main()
{
vec2 uv = gl_FragCoord.xy / iResolution.xy;
float sinDegree = sin(PI_HALF * iTime);
float sinDegreeOffset = si