3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
344 stars 30 forks source link

wrong ETA when rendering only parts of an animation #151

Closed claudeha closed 3 years ago

claudeha commented 3 years ago

Describe the bug ETA 20minutes and counting (upwards), when it takes 4 seconds per frame and is on frame 7815/13320, having resumed rendering after a system crash (not caused by FragM) at frame 7515 (which took about 12 hours). So ETA should be about 10 hours, but it seems to think (maybe) the time taken for rendering includes having rendered the previous frames so it thinks it's much faster than it really is? Info window has correct avg sec per tile, though, haven't checked the code yet to know exactly what is wrong...

To Reproduce

  1. Go to animation renderer
  2. Select only the second half of the animation
  3. Activate rendering
  4. See misleading ETA

Expected behavior ETA to be based on the frames selected for rendering, not some mismatched combination of total frames or so.

Desktop (please complete the following information):

3Dickulus commented 3 years ago

I recall some optimizations some time ago for a more accurate ETA, haven't looked at this for a while, seems accurate only when rendering a subset from frame one, 300 frames = 1-300 accurate, 1-150 accurate, 150-300 ETA is missing the the accumulation from previous frames.

calculate initial accumulation as ( current_frame_index * first_frame_of_sequence_render_time ) won't be terribly accurate as render duration can vary a lot from frame to frame. Yes need to calculate remaining based on current and ignore previous accumulation.

3Dickulus commented 3 years ago

26da96d Seems to work, can you verify?

3Dickulus commented 3 years ago

Setting total accumulated time to (current_frame_index * last_frame_render_time) when accumulated time is unknown ie: restarting rendering in the middle of an animation or when rendering a sub-set of frames.

3Dickulus commented 3 years ago

maybe should rename a few of the vars used here like startTime should be startFrame because it's actually the frame index and not a time reference