Make light emission uniform

This commit is contained in:
numzero 2024-12-29 18:28:22 +03:00
parent 9576078f9c
commit 127b7a4077

View File

@ -88,7 +88,7 @@ fn trace_fragment(in: Varying) -> vec4f {
let s = spheres[sphere];
pos += t * ray;
let normal = (pos - s.center) / s.radius;
result += vec4(color * s.emit_color * -dot(normal, ray), 0.0);
result += vec4(color * s.emit_color, 0.0);
color *= s.reflect_color;
let diffuse = normal + rand_sphere();
let specular = reflect(ray, normal);