Bläddra i källkod

WebGLRenderer: Removed toneMappingWhitePoint

Mr.doob 5 år sedan
förälder
incheckning
ea7653e426

+ 0 - 5
docs/api/en/renderers/WebGLRenderer.html

@@ -275,11 +275,6 @@
 		Exposure level of tone mapping. Default is *1*.
 		</p>
 
-		<h3>[property:Number toneMappingWhitePoint]</h3>
-		<p>
-		Tone mapping white point. Default is *1*.
-		</p>
-
 		<h3>[property:WebXRManager xr]</h3>
 		<p>
 		Provides access to the WebXR related [page:WebXRManager interface] of the renderer.

+ 0 - 5
docs/api/zh/renderers/WebGLRenderer.html

@@ -252,11 +252,6 @@
 		色调映射的曝光级别。默认是*1*
 		</p>
 
-		<h3>[property:Number toneMappingWhitePoint]</h3>
-		<p>
-		色调映射的白点。默认是*1*
-		</p>
-
 		<h3>[property:WebXRManager xr]</h3>
 		<p>
 		Provides access to the WebXR related [page:WebXRManager interface] of the renderer.

+ 0 - 1
editor/js/Config.js

@@ -22,7 +22,6 @@ var Config = function () {
 		'project/renderer/physicallyCorrectLights': false,
 		'project/renderer/toneMapping': 0, // NoToneMapping
 		'project/renderer/toneMappingExposure': 1,
-		'project/renderer/toneMappingWhitePoint': 1,
 
 		'settings/history': false,
 

+ 1 - 2
editor/js/Editor.js

@@ -695,8 +695,7 @@ Editor.prototype = {
 				vr: this.config.getKey( 'project/vr' ),
 				physicallyCorrectLights: this.config.getKey( 'project/renderer/physicallyCorrectLights' ),
 				toneMapping: this.config.getKey( 'project/renderer/toneMapping' ),
-				toneMappingExposure: this.config.getKey( 'project/renderer/toneMappingExposure' ),
-				toneMappingWhitePoint: this.config.getKey( 'project/renderer/toneMappingWhitePoint' ),
+				toneMappingExposure: this.config.getKey( 'project/renderer/toneMappingExposure' )
 			},
 			camera: this.camera.toJSON(),
 			scene: this.scene.toJSON(),

+ 1 - 24
editor/js/Sidebar.Project.js

@@ -159,10 +159,6 @@ var SidebarProject = function ( editor ) {
 		config.setKey( 'project/renderer/toneMapping', toneMapping );
 		updateRenderer();
 
-		// WebGLRenderer.whitePoint is only relevant for Uncharted2 tonemapping
-
-		toneMappingWhitePointRow.setDisplay( ( toneMapping === 3 ) ? 'block' : 'none' );
-
 	} );
 	toneMappingSelect.setValue( config.getKey( 'project/renderer/toneMapping' ) );
 
@@ -185,21 +181,6 @@ var SidebarProject = function ( editor ) {
 	toneMappingExposureRow.add( toneMappingExposure );
 	rendererPanel.add( toneMappingExposureRow );
 
-	// Tonemapping / White Point
-
-	var toneMappingWhitePointRow = new UIRow();
-	var toneMappingWhitePoint = new UINumber( config.getKey( 'project/renderer/toneMappingWhitePoint' ) ).setRange( 0, 10 ).onChange( function () {
-
-		config.setKey( 'project/renderer/toneMappingWhitePoint', this.getValue() );
-		updateTonemapping();
-
-	} );
-
-	toneMappingWhitePointRow.add( new UIText( strings.getKey( 'sidebar/project/toneMappingWhitePoint' ) ).setWidth( '90px' ) );
-	toneMappingWhitePointRow.add( toneMappingWhitePoint );
-	rendererPanel.add( toneMappingWhitePointRow );
-	toneMappingWhitePointRow.setDisplay( ( config.getKey( 'project/renderer/toneMapping' ) === 3 ? 'block' : 'none' ) );
-
 	//
 
 	function updateRenderer() {
@@ -210,13 +191,12 @@ var SidebarProject = function ( editor ) {
 			shadowTypeSelect.getValue(),
 			toneMappingSelect.getValue(),
 			toneMappingExposure.getValue(),
-			toneMappingWhitePoint.getValue(),
 			physicallyCorrectLightsBoolean.getValue()
 		);
 
 	}
 
-	function createRenderer( antialias, shadows, shadowType, toneMapping, toneMappingExposure, toneMappingWhitePoint, physicallyCorrectLights ) {
+	function createRenderer( antialias, shadows, shadowType, toneMapping, toneMappingExposure, physicallyCorrectLights ) {
 
 		var parameters = { antialias: antialias };
 
@@ -241,7 +221,6 @@ var SidebarProject = function ( editor ) {
 
 		currentRenderer.toneMapping = parseFloat( toneMapping );
 		currentRenderer.toneMappingExposure = toneMappingExposure;
-		currentRenderer.toneMappingWhitePoint = toneMappingWhitePoint;
 		currentRenderer.physicallyCorrectLights = physicallyCorrectLights;
 
 		signals.rendererChanged.dispatch( currentRenderer, currentPmremGenerator );
@@ -251,7 +230,6 @@ var SidebarProject = function ( editor ) {
 	function updateTonemapping() {
 
 		currentRenderer.toneMappingExposure = toneMappingExposure.getValue();
-		currentRenderer.toneMappingWhitePoint = toneMappingWhitePoint.getValue();
 
 		signals.rendererUpdated.dispatch();
 
@@ -263,7 +241,6 @@ var SidebarProject = function ( editor ) {
 		config.getKey( 'project/renderer/shadowType' ),
 		config.getKey( 'project/renderer/toneMapping' ),
 		config.getKey( 'project/renderer/toneMappingExposure' ),
-		config.getKey( 'project/renderer/toneMappingWhitePoint' ),
 		config.getKey( 'project/renderer/physicallyCorrectLights' )
 	 );
 

+ 0 - 3
editor/js/Strings.js

@@ -294,7 +294,6 @@ var Strings = function ( config ) {
 			'sidebar/project/physicallyCorrectLights': 'Physically correct lights',
 			'sidebar/project/toneMapping': 'Tone mapping',
 			'sidebar/project/toneMappingExposure': 'Exposure',
-			'sidebar/project/toneMappingWhitePoint': 'White Point',
 			'sidebar/project/materials': 'Materials',
 			'sidebar/project/Assign': 'Assign',
 
@@ -609,7 +608,6 @@ var Strings = function ( config ) {
 			'sidebar/project/physicallyCorrectLights': 'Rendu physique lumineux',
 			'sidebar/project/toneMapping': 'Mappage des nuances',
 			'sidebar/project/toneMappingExposure': 'Réglage d\'exposition',
-			'sidebar/project/toneMappingWhitePoint': 'Réglage du point blanc',
 			'sidebar/project/materials': 'Matériaux',
 			'sidebar/project/Assign': 'Attribuer',
 
@@ -898,7 +896,6 @@ var Strings = function ( config ) {
 			'sidebar/project/physicallyCorrectLights': '物理光照',
 			'sidebar/project/toneMapping': '色调映射',
 			'sidebar/project/toneMappingExposure': '曝光',
-			'sidebar/project/toneMappingWhitePoint': '白点',
 			'sidebar/project/materials': '材质',
 			'sidebar/project/Assign': '应用',
 

+ 0 - 1
editor/js/libs/app.js

@@ -35,7 +35,6 @@ var APP = {
 			if ( project.shadowType !== undefined ) renderer.shadowMap.type = project.shadowType;
 			if ( project.toneMapping !== undefined ) renderer.toneMapping = project.toneMapping;
 			if ( project.toneMappingExposure !== undefined ) renderer.toneMappingExposure = project.toneMappingExposure;
-			if ( project.toneMappingWhitePoint !== undefined ) renderer.toneMappingWhitePoint = project.toneMappingWhitePoint;
 			if ( project.physicallyCorrectLights !== undefined ) renderer.physicallyCorrectLights = project.physicallyCorrectLights;
 
 			this.setScene( loader.parse( json.scene ) );

+ 1 - 25
examples/webgl_tonemapping.html

@@ -25,13 +25,10 @@
 			import { RGBELoader } from './jsm/loaders/RGBELoader.js';
 
 			var mesh, renderer, scene, camera, controls;
-			var gui,
-				guiWhitePoint = null,
-				guiExposure = null;
+			var gui, guiExposure = null;
 
 			var params = {
 				exposure: 0.8,
-				whitePoint: 1.0, // applies to Uncharted2 only
 				toneMapping: 'ACESFilmic'
 			};
 
@@ -58,7 +55,6 @@
 				document.body.appendChild( renderer.domElement );
 
 				renderer.toneMapping = toneMappingOptions[ params.toneMapping ];
-				renderer.toneMappingWhitePoint = params.whitePoint;
 				renderer.toneMappingExposure = params.exposure;
 
 				renderer.outputEncoding = THREE.sRGBEncoding;
@@ -138,13 +134,6 @@
 
 			function updateGUI() {
 
-				if ( guiWhitePoint !== null ) {
-
-					gui.remove( guiWhitePoint );
-					guiWhitePoint = null;
-
-				}
-
 				if ( guiExposure !== null ) {
 
 					gui.remove( guiExposure );
@@ -165,19 +154,6 @@
 
 				}
 
-				if ( params.toneMapping === 'Uncharted2' ) {
-
-					guiWhitePoint = gui.add( params, 'whitePoint', 0, 2 )
-
-						.onChange( function () {
-
-							renderer.toneMappingWhitePoint = params.whitePoint;
-							render();
-
-						} );
-
-				}
-
 			}
 
 			function onWindowResize() {

+ 14 - 1
src/Three.Legacy.js

@@ -1829,7 +1829,20 @@ Object.defineProperties( WebGLRenderer.prototype, {
 			this.outputEncoding = ( value === true ) ? sRGBEncoding : LinearEncoding;
 
 		}
-	}
+	},
+	toneMappingWhitePoint: {
+		get: function () {
+
+			console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );
+			return 1.0;
+
+		},
+		set: function () {
+
+			console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );
+
+		}
+	},
 
 } );
 

+ 0 - 1
src/renderers/WebGLRenderer.d.ts

@@ -163,7 +163,6 @@ export class WebGLRenderer implements Renderer {
 	physicallyCorrectLights: boolean;
 	toneMapping: ToneMapping;
 	toneMappingExposure: number;
-	toneMappingWhitePoint: number;
 
 	/**
 	 * Default is false.

+ 0 - 2
src/renderers/WebGLRenderer.js

@@ -108,7 +108,6 @@ function WebGLRenderer( parameters ) {
 
 	this.toneMapping = NoToneMapping;
 	this.toneMappingExposure = 1.0;
-	this.toneMappingWhitePoint = 1.0;
 
 	// morphs
 
@@ -1834,7 +1833,6 @@ function WebGLRenderer( parameters ) {
 		if ( refreshMaterial ) {
 
 			p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
-			p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
 
 			if ( materialProperties.needsLights ) {
 

+ 3 - 4
src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js

@@ -5,7 +5,6 @@ export default /* glsl */`
 #endif
 
 uniform float toneMappingExposure;
-uniform float toneMappingWhitePoint;
 
 // exposure only
 vec3 LinearToneMapping( vec3 color ) {
@@ -22,17 +21,17 @@ vec3 ReinhardToneMapping( vec3 color ) {
 
 }
 
-// source: http://filmicgames.com/archives/75
+// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/
 #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 ) )
 vec3 Uncharted2ToneMapping( vec3 color ) {
 
 	// John Hable's filmic operator from Uncharted 2 video game
 	color *= toneMappingExposure;
-	return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
+	return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( 1.0 ) ) );
 
 }
 
-// source: http://filmicgames.com/archives/75
+// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/
 vec3 OptimizedCineonToneMapping( vec3 color ) {
 
 	// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson