Skip to content

Commit

Permalink
fixes tweakpane to allow disabling of custom tone mapping (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCodeTherapy authored Aug 15, 2023
1 parent 78df22f commit 74874a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 2 additions & 6 deletions packages/3d-web-client-core/src/tweakpane/TweakPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,8 @@ export class TweakPane {
break;
case "toneMapping":
this.renderer.toneMapping = e.value;
if (e.value !== 5 && e.value !== 0) {
this.toneMapping.hidden = true;
} else {
this.toneMapping.hidden = false;
}
toneMappingPass.enabled = e.value === 5 || e.value === 0 ? true : false;
this.toneMapping.hidden = e.value !== 5;
toneMappingPass.enabled = e.value === 5 ? true : false;
setToneMappingType(e.value);
break;
case "exposure":
Expand Down
12 changes: 6 additions & 6 deletions packages/3d-web-client-core/src/tweakpane/composerSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { BlendFunction, ToneMappingMode } from "postprocessing";
export const composerValues = {
renderer: {
shadowMap: 2,
toneMapping: 4,
toneMapping: 5,
exposure: 1,
bgIntensity: 0.6,
bgIntensity: 0.5,
bgBlurriness: 0.0,
},
ssao: {
Expand Down Expand Up @@ -37,9 +37,9 @@ export const composerValues = {
},
brightness: -0.03,
contrast: 1.3,
saturation: 0.95,
grain: 0.055,
bloom: 0.4,
saturation: 0.91,
grain: 0.061,
bloom: 0.45,
};

export const composerOptions = {
Expand Down Expand Up @@ -86,7 +86,7 @@ export const composerOptions = {
amount: { min: 0, max: 0.2, step: 0.002 },
},
bloom: {
amount: { min: 0, max: 4, step: 0.1 },
amount: { min: 0, max: 2, step: 0.05 },
},
};

Expand Down

0 comments on commit 74874a9

Please sign in to comment.