Fix floating-point precision issue in accumulation_buffer

Fixed an issue that prevented the image from converging.

(Technically, the convergence was happening and the issue was the final
calculation of the displayed colours, but the visual effect was the same as
failure to converge.)
This commit is contained in:
Matthew Gordon 2025-03-21 20:52:23 -03:00
parent 07651817dc
commit 406f347971
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ impl AccumulationBuffer {
let colour_sum_t = buffer_colour_sum.values + colour_sum_y;
buffer_colour_bias.values = (colour_sum_t - buffer_colour_sum.values) - colour_sum_y;
buffer_colour_sum.values = colour_sum_t;
buffer_colour.values = buffer_colour_sum.values * (1.0 / *buffer_weight);
buffer_colour.values = buffer_colour_sum.values / *buffer_weight;
}
pub fn merge_tile(&mut self, tile: &Tile, src: &AccumulationBuffer) {