第 2 课:Ambient Lighting
实现
uniform sampler2D iChannel0;
varying vec2 vUv;
void main() {
vec4 tex = texture(iChannel0, vUv);
float ambientFactor = 0.5;
vec4 lightColor = vec4(1.0, 1.0, 0.0,1.0);
gl_FragColor = vec4(tex.rgb * lightColor.rgb * ambientFactor,1.0);
}