Skip to content

Commit

Permalink
Fix flame artifacts showing up after days
Browse files Browse the repository at this point in the history
Due to floating point precision problems the flames started to look
weird after some days. With this change in place, we just reset the time
once or place per day to stop this from happening.
  • Loading branch information
walles committed Aug 6, 2023
1 parent 4ec4594 commit d50b675
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libloadviz/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ impl Renderer {
// FIXME: Draw something nice?
return;
}

// Too high values make the flames look like they have JPEG artifacts.
//
// Experiments showed that 14 days was really bad. 7 days was not bad.
// So let's cap it at somewhere around 70% of one day so that the cut
// comes at different times every day.
let dt_seconds = dt_seconds % (3600.0 * 17.3);

let viz_loads = mirror_sort(currently_displayed_loads);

for pixel_x in 0..width {
Expand Down

0 comments on commit d50b675

Please sign in to comment.