WEBGL 学习日志

S 学习日志

smoothstep 发光

image-20231225195921548
1
2
3
4
5
6
7
8
9
10
11
12
13
vec2 fixUV(in vec2 c) {
return (2. * c - iResolution.xy) / min(iResolution.x, iResolution.y);
}

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Normalized pixel coordinates (from 0 to 1)
vec2 uv = fixUV(fragCoord);
vec3 col = vec3( 0.9 , 0.65 , 0.1 ) ;
float d= length(uv);
col = mix(col.rgb , vec3(0. ) , smoothstep( 0.5 ,1. , d ) );
fragColor = vec4(col,1.0);
}

WEBGL 学习日志
http://example.com/2024/05/23/webgl/WEBGL 学习日志/
Author
John Doe
Posted on
May 23, 2024
Licensed under