Browse Source

Editor: Rename `physicallyCorrectLights` to `useLegacyLights` (#25556)

* Editor: physicallyCorrectLights -> useLegacyLights

* Update Strings.js

* Update `useLegacyLights` for `zh`

---------

Co-authored-by: Michael Herzog <[email protected]>
linbingquan 2 years ago
parent
commit
c3c7cafe9c
5 changed files with 16 additions and 16 deletions
  1. 1 1
      editor/js/Config.js
  2. 1 1
      editor/js/Editor.js
  3. 10 10
      editor/js/Sidebar.Project.Renderer.js
  4. 3 3
      editor/js/Strings.js
  5. 1 1
      editor/js/libs/app.js

+ 1 - 1
editor/js/Config.js

@@ -14,7 +14,7 @@ function Config() {
 		'project/renderer/antialias': true,
 		'project/renderer/shadows': true,
 		'project/renderer/shadowType': 1, // PCF
-		'project/renderer/physicallyCorrectLights': false,
+		'project/renderer/useLegacyLights': false,
 		'project/renderer/toneMapping': 0, // NoToneMapping
 		'project/renderer/toneMappingExposure': 1,
 

+ 1 - 1
editor/js/Editor.js

@@ -691,7 +691,7 @@ Editor.prototype = {
 				shadows: this.config.getKey( 'project/renderer/shadows' ),
 				shadowType: this.config.getKey( 'project/renderer/shadowType' ),
 				vr: this.config.getKey( 'project/vr' ),
-				physicallyCorrectLights: this.config.getKey( 'project/renderer/physicallyCorrectLights' ),
+				useLegacyLights: this.config.getKey( 'project/renderer/useLegacyLights' ),
 				toneMapping: this.config.getKey( 'project/renderer/toneMapping' ),
 				toneMappingExposure: this.config.getKey( 'project/renderer/toneMappingExposure' )
 			},

+ 10 - 10
editor/js/Sidebar.Project.Renderer.js

@@ -29,18 +29,18 @@ function SidebarProjectRenderer( editor ) {
 
 	// Physically Correct lights
 
-	const physicallyCorrectLightsRow = new UIRow();
-	container.add( physicallyCorrectLightsRow );
+	const useLegacyLightsRow = new UIRow();
+	container.add( useLegacyLightsRow );
 
-	physicallyCorrectLightsRow.add( new UIText( strings.getKey( 'sidebar/project/physicallyCorrectLights' ) ).setWidth( '90px' ) );
+	useLegacyLightsRow.add( new UIText( strings.getKey( 'sidebar/project/useLegacyLights' ) ).setWidth( '90px' ) );
 
-	const physicallyCorrectLightsBoolean = new UIBoolean( config.getKey( 'project/renderer/physicallyCorrectLights' ) ).onChange( function () {
+	const useLegacyLightsBoolean = new UIBoolean( config.getKey( 'project/renderer/useLegacyLights' ) ).onChange( function () {
 
-		currentRenderer.physicallyCorrectLights = this.getValue();
+		currentRenderer.useLegacyLights = this.getValue();
 		signals.rendererUpdated.dispatch();
 
 	} );
-	physicallyCorrectLightsRow.add( physicallyCorrectLightsBoolean );
+	useLegacyLightsRow.add( useLegacyLightsBoolean );
 
 	// Shadows
 
@@ -110,7 +110,7 @@ function SidebarProjectRenderer( editor ) {
 
 		currentRenderer = new THREE.WebGLRenderer( { antialias: antialiasBoolean.getValue() } );
 		currentRenderer.outputEncoding = THREE.sRGBEncoding;
-		currentRenderer.physicallyCorrectLights = physicallyCorrectLightsBoolean.getValue();
+		currentRenderer.useLegacyLights = useLegacyLightsBoolean.getValue();
 		currentRenderer.shadowMap.enabled = shadowsBoolean.getValue();
 		currentRenderer.shadowMap.type = parseFloat( shadowTypeSelect.getValue() );
 		currentRenderer.toneMapping = parseFloat( toneMappingSelect.getValue() );
@@ -128,13 +128,13 @@ function SidebarProjectRenderer( editor ) {
 
 	signals.editorCleared.add( function () {
 
-		currentRenderer.physicallyCorrectLights = false;
+		currentRenderer.useLegacyLights = false;
 		currentRenderer.shadowMap.enabled = true;
 		currentRenderer.shadowMap.type = THREE.PCFShadowMap;
 		currentRenderer.toneMapping = THREE.NoToneMapping;
 		currentRenderer.toneMappingExposure = 1;
 
-		physicallyCorrectLightsBoolean.setValue( currentRenderer.physicallyCorrectLights );
+		useLegacyLightsBoolean.setValue( currentRenderer.useLegacyLights );
 		shadowsBoolean.setValue( currentRenderer.shadowMap.enabled );
 		shadowTypeSelect.setValue( currentRenderer.shadowMap.type );
 		toneMappingSelect.setValue( currentRenderer.toneMapping );
@@ -149,7 +149,7 @@ function SidebarProjectRenderer( editor ) {
 
 		config.setKey(
 			'project/renderer/antialias', antialiasBoolean.getValue(),
-			'project/renderer/physicallyCorrectLights', physicallyCorrectLightsBoolean.getValue(),
+			'project/renderer/useLegacyLights', useLegacyLightsBoolean.getValue(),
 			'project/renderer/shadows', shadowsBoolean.getValue(),
 			'project/renderer/shadowType', parseFloat( shadowTypeSelect.getValue() ),
 			'project/renderer/toneMapping', parseFloat( toneMappingSelect.getValue() ),

+ 3 - 3
editor/js/Strings.js

@@ -317,7 +317,7 @@ function Strings( config ) {
 			'sidebar/project/renderer': 'Renderer',
 			'sidebar/project/antialias': 'Antialias',
 			'sidebar/project/shadows': 'Shadows',
-			'sidebar/project/physicallyCorrectLights': 'Physical lights',
+			'sidebar/project/useLegacyLights': 'Use legacy lights',
 			'sidebar/project/toneMapping': 'Tone mapping',
 			'sidebar/project/materials': 'Materials',
 			'sidebar/project/Assign': 'Assign',
@@ -669,7 +669,7 @@ function Strings( config ) {
 			'sidebar/project/renderer': 'Rendus',
 			'sidebar/project/antialias': 'Anticrénelage',
 			'sidebar/project/shadows': 'Ombres',
-			'sidebar/project/physicallyCorrectLights': 'Physical lights',
+			'sidebar/project/useLegacyLights': 'Use legacy lights',
 			'sidebar/project/toneMapping': 'Mappage des nuances',
 			'sidebar/project/materials': 'Matériaux',
 			'sidebar/project/Assign': 'Attribuer',
@@ -1021,7 +1021,7 @@ function Strings( config ) {
 			'sidebar/project/renderer': '渲染器',
 			'sidebar/project/antialias': '抗锯齿',
 			'sidebar/project/shadows': '阴影',
-			'sidebar/project/physicallyCorrectLights': '物理灯',
+			'sidebar/project/useLegacyLights': '传统灯',
 			'sidebar/project/toneMapping': '色调映射',
 			'sidebar/project/materials': '材质',
 			'sidebar/project/Assign': '应用',

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

@@ -30,7 +30,7 @@ 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.physicallyCorrectLights !== undefined ) renderer.physicallyCorrectLights = project.physicallyCorrectLights;
+			if ( project.useLegacyLights !== undefined ) renderer.useLegacyLights = project.useLegacyLights;
 
 			this.setScene( loader.parse( json.scene ) );
 			this.setCamera( loader.parse( json.camera ) );