瀏覽代碼

Editor: Slightly improve renderer settings.

Mugen87 5 年之前
父節點
當前提交
0ffca54258
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      editor/js/Sidebar.Project.js

+ 8 - 2
editor/js/Sidebar.Project.js

@@ -103,7 +103,7 @@ var SidebarProject = function ( editor ) {
 	//	3: 'VSM'
 	} ).setWidth( '150px' ).onChange( function () {
 
-		config.setKey( 'project/renderer/shadowType', this.getValue() );
+		config.setKey( 'project/renderer/shadowType', parseFloat( this.getValue() ) );
 		updateRenderer();
 
 	} );
@@ -141,9 +141,14 @@ var SidebarProject = function ( editor ) {
 		5: 'ACESFilmic',
 	} ).setWidth( '150px' ).onChange( function () {
 
-		config.setKey( 'project/renderer/toneMapping', this.getValue() );
+		var toneMapping = parseFloat( this.getValue() );
+		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' ) );
 
@@ -179,6 +184,7 @@ var SidebarProject = function ( editor ) {
 	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' ) );
 
 	//