fix a bug

it's invisible with Lambertian model though
This commit is contained in:
numzero 2025-11-24 00:19:28 +03:00
parent fb8ea92ce8
commit a51f46a038

View File

@ -309,7 +309,8 @@ impl Core {
assert!(hit.incident.dir.is_normalized()); assert!(hit.incident.dir.is_normalized());
let reflector = Lambertian; let reflector = Lambertian;
let in_lm = 1.0; let in_lm = 1.0;
let out_cd = in_lm * reflector.brdf(hit.normal, hit.incident.dir, -ray.dir); let out_cd =
in_lm * reflector.brdf(light_hit.normal, light_hit.incident.dir, -ray.dir);
let weight = accum_normalizator * (-0.5 * d2 / sigma2).exp(); let weight = accum_normalizator * (-0.5 * d2 / sigma2).exp();
total_cd += weight * out_cd; total_cd += weight * out_cd;
} }