- いろんな角度で行けるように極座標にする
- 回転後の座標系を使い、ランダム関数に渡して短冊状のずれを生む
float gx = glitch.z;//分割数 vec2 displace = vec2(0.0,0.0); float rad = glitch.y;//; //座標を回転 float nx = newUV.x * cos(-rad) - newUV.y * sin(-rad); float ny = newUV.x * sin(-rad) + newUV.y * cos(-rad); float amp = glitch.x * (random(vec2(floor((ny)*gx)/gx,0.0))-0.5); displace.x = amp * cos(rad);//-3.1415/2.); displace.y = amp * sin(rad);//-3.1415/2.); //displace.x += ( (random( vec2(floor(newUV.y*gx)/gx,0.0) )-0.5) * glitch.x ); //displace.y += ( -random( vec2(floor((newUV.x+newUV.y)*gx)/gx,0.0) ) * glitch.x ); newUV.xy += displace; newUV.x = fract( newUV.x ); newUV.y = fract( newUV.y );