optimize summation
This commit is contained in:
parent
aa56768655
commit
bb8373fad5
|
|
@ -257,6 +257,9 @@ impl Core {
|
||||||
let mut value = 0.0f32;
|
let mut value = 0.0f32;
|
||||||
for light_hit in &hits {
|
for light_hit in &hits {
|
||||||
let d2 = hit.base.distance_squared(light_hit.base);
|
let d2 = hit.base.distance_squared(light_hit.base);
|
||||||
|
if d2 > 3. * sigma2 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let w = (-0.5 * d2 / sigma2).exp();
|
let w = (-0.5 * d2 / sigma2).exp();
|
||||||
value += w;
|
value += w;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user