Skip to content

Commit

Permalink
Add exposure to gui (#29311)
Browse files Browse the repository at this point in the history
  • Loading branch information
WestLangley authored Sep 4, 2024
1 parent ce46a65 commit 7c5ac38
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions examples/webgl_tonemapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@
window.addEventListener( 'resize', onWindowResize );

gui = new GUI();
const toneMappingFolder = gui.addFolder( 'tone mapping' );
const toneMappingFolder = gui.addFolder( 'Tone Mapping' );

toneMappingFolder.add( params, 'toneMapping', Object.keys( toneMappingOptions ) )

.name( 'type' )
.onChange( function () {

updateGUI( toneMappingFolder );
Expand All @@ -142,7 +143,16 @@

} );

const backgroundFolder = gui.addFolder( 'background' );
guiExposure = toneMappingFolder.add( params, 'exposure', 0, 2 )

.onChange( function ( value ) {

renderer.toneMappingExposure = value;
render();

} );

const backgroundFolder = gui.addFolder( 'Background' );

backgroundFolder.add( params, 'blurriness', 0, 1 )

Expand Down Expand Up @@ -170,23 +180,13 @@

function updateGUI( folder ) {

if ( guiExposure !== null ) {

guiExposure.destroy();
guiExposure = null;

}

if ( params.toneMapping !== 'None' ) {

guiExposure = folder.add( params, 'exposure', 0, 2 )
if ( params.toneMapping === 'None' ) {

.onChange( function () {
guiExposure.hide();

renderer.toneMappingExposure = params.exposure;
render();
} else {

} );
guiExposure.show();

}

Expand Down

0 comments on commit 7c5ac38

Please sign in to comment.