Skip to content

Commit

Permalink
White space clean up (#26678)
Browse files Browse the repository at this point in the history
  • Loading branch information
WestLangley committed Sep 1, 2023
1 parent c02fb47 commit 3c7f5e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/webgl_tonemapping.html
Expand Up @@ -72,18 +72,23 @@
renderer.toneMapping = toneMappingOptions[ params.toneMapping ];
renderer.toneMappingExposure = params.exposure;


// Set CustomToneMapping to Uncharted2
// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/

THREE.ShaderChunk.tonemapping_pars_fragment = THREE.ShaderChunk.tonemapping_pars_fragment.replace(

'vec3 CustomToneMapping( vec3 color ) { return color; }',

`#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )
float toneMappingWhitePoint = 1.0;
vec3 CustomToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
}`

);

scene = new THREE.Scene();
Expand Down Expand Up @@ -138,6 +143,7 @@
render();

} );

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

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

0 comments on commit 3c7f5e6

Please sign in to comment.