Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
onSampleRendered returns time elapsed (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Crane authored Mar 27, 2020
1 parent c397873 commit 73d3727
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/renderer/RenderingPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function makeRenderingPipeline({

let frameTime;
let elapsedFrameTime;
let sampleTime;

let sampleCount = 0;
let numPreviewsRendered = 0;
Expand Down Expand Up @@ -311,6 +312,9 @@ export function makeRenderingPipeline({
if (sampleCount === 0) { // previous rendered image was a preview image
clearBuffer(hdrBuffer);
reprojectPass.setPreviousCamera(lastCamera);
} else {
sampleRenderedCallback(sampleCount, frameTime - sampleTime || NaN);
sampleTime = frameTime;
}

updateSeed(screenWidth, screenHeight, true);
Expand Down Expand Up @@ -344,8 +348,6 @@ export function makeRenderingPipeline({
} else {
toneMapToScreen(hdrBuffer.color[0], fullscreenScale);
}

sampleRenderedCallback(sampleCount);
}
}

Expand Down

0 comments on commit 73d3727

Please sign in to comment.