fix double-accounting for surface slope

This commit is contained in:
numzero 2025-11-23 21:02:38 +03:00
parent 707bb6f66e
commit fb8ea92ce8

View File

@ -309,9 +309,7 @@ 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 let out_cd = in_lm * reflector.brdf(hit.normal, hit.incident.dir, -ray.dir);
* hit.normal.dot(-hit.incident.dir)
* reflector.brdf(hit.normal, 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;
} }