2/11

日記

2026/02/11

Three.js

glsl mix関数の第3引数にfloat以外

mix()の前2つの引数と同じ型が使える。
これでvec3だとしたらそれぞれでmixが行える。

vec3 blue = vec3(0.15,0.13,0.9);
vec3 yellow = vec3(1.0,0.8,0.2);

float plot(vec2 st, float pct) {
return smoothstep(pct-0.01, pct, st.y) -
smoothstep(pct, pct+0.01, st.y);
}

void main() {
 vec2 st = gl_FragCoord.xy / uResolution;
 float y = st.y;
 vec3 color = vec3(0.0);

 vec3 pct = vec3(st.x);

 pct.r = smoothstep(0.0, 1.0, st.x);
 pct.g = sin(st.x * PI);
 pct.b = pow(st.x, 0.5);

 color = mix(blue, yellow, pct);

 color = mix(color, vec3(1.0, 0.0, 0.0), plot(st, pct.r));
 color = mix(color, vec3(0.0, 1.0, 0.0), plot(st, pct.g));
 color = mix(color, vec3(0.0, 0.0, 1.0), plot(st, pct.b));
 gl_FragColor = vec4(color, 1.0);
}

英語

halo  後光

mother-in-low  義母

scam  詐欺

make it to the fridge  冷蔵庫までたどり着く
make it  「(頑張ってやっと)成し遂げる」 
I finally made it to the top.   (ついに頂上にたどり着いた。)
I made it!!!  ついにできた!

Wouldn't you say? 「〜だと思わない?」

On second thought  よく考えると、やっぱり

get the upper hand  優位に立つ

dont be mean to her  いじわるしない

sorry I bumped into you earlier  さっきはぶつかってごめん

It means a lot. すごくうれしい、重要な意味をもつ

Jump the gun 「早まった行動を取る」「フライングする」「焦って何かをする」

my treat   俺の奢り