fract like triangle wave
UVをミラー的に折り返したいとき。
GLSL Grapher で描画
float y(float x) { return abs(2.0*fract(0.5*x-0.5)-1.0); }
unityのシェーダーで。
//hlsl float2 sankaku(float2 x) { return abs(2.0*frac(0.5*x-0.5)-1.0); }
fract like triangle wave
UVをミラー的に折り返したいとき。
float y(float x) { return abs(2.0*fract(0.5*x-0.5)-1.0); }
//hlsl float2 sankaku(float2 x) { return abs(2.0*frac(0.5*x-0.5)-1.0); }