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

Commit

Permalink
Tweak reprojection amount & decrease bounces to 2 (#58)
Browse files Browse the repository at this point in the history
* tweak reprojection amount

* lower numUniformSamples and maxReprojectedSamples

* increase numUniformSamples from 3 to 4 for scenes with more GI

Co-authored-by: Noah Lyons <[email protected]>
  • Loading branch information
Lucas Crane and Noah Lyons committed Jan 14, 2020
1 parent a68cf9d commit 739e1df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions scenes/webgl-comparison/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function initRenderer(renderer) {
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.5;
renderer.renderWhenOffFocus = false;
renderer.bounces = 3;
}

function unloadRenderer(renderer) {
Expand Down
2 changes: 1 addition & 1 deletion src/RayTracingRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function RayTracingRenderer(params = {}) {
let pixelRatio = 1;

const module = {
bounces: 3,
bounces: 2,
domElement: canvas,
maxHardwareUsage: false,
needsUpdate: true,
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/RenderingPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ export function makeRenderingPipeline({
bounces, // number of global illumination bounces
}) {

const reprojectDecay = 0.975;
const maxReprojectedSamples = Math.round(reprojectDecay / (1 - reprojectDecay));
const maxReprojectedSamples = 20;

// how many samples to render with uniform noise before switching to stratified noise
const numUniformSamples = 6;
const numUniformSamples = 4;

// how many partitions of stratified noise should be created
// higher number results in faster convergence over time, but with lower quality initial samples
Expand Down Expand Up @@ -231,7 +230,7 @@ export function makeRenderingPipeline({
reprojectBuffer.bind();
gl.viewport(0, 0, previewWidth, previewHeight);
reprojectPass.draw({
blendAmount: reprojectDecay,
blendAmount: 1.0,
light: hdrBuffer.attachments[rayTracePass.outputLocs.light],
position: hdrBuffer.attachments[rayTracePass.outputLocs.position],
textureScale: previewScale,
Expand Down

0 comments on commit 739e1df

Please sign in to comment.