Ditch envmap in favor of clear blue sky

It’s photometric now!
This commit is contained in:
numzero 2025-03-29 00:00:04 +03:00
parent 7671e04adc
commit b637590308

View File

@ -104,8 +104,14 @@ fn trace_fragment(in: Varying) -> vec3f {
} }
} }
if (sphere == -1) { if (sphere == -1) {
let env = textureSampleLevel(env_texture, env_sampler, ray, 0.0); let theta = dot(ray, normalize(vec3(0., 0., 1.)));
result += 3.0 * color * env.xyz; var env: vec3f; // in kilonits
if (theta > 0.999988647254458) {
env = vec3(1.6e6, 1.5e6, 1.0e6);
} else {
env = mix(vec3(0.5, 1.0, 2.0), vec3(2.0, 3.0, 4.0), 0.5 * theta + 0.5);
}
result += color * env.xyz;
break; break;
} }
let s = spheres[sphere]; let s = spheres[sphere];