Explorar o código

Editor: Slightly improve renderer settings.

Mugen87 %!s(int64=5) %!d(string=hai) anos
pai
achega
0ffca54258
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  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'
 	//	3: 'VSM'
 	} ).setWidth( '150px' ).onChange( function () {
 	} ).setWidth( '150px' ).onChange( function () {
 
 
-		config.setKey( 'project/renderer/shadowType', this.getValue() );
+		config.setKey( 'project/renderer/shadowType', parseFloat( this.getValue() ) );
 		updateRenderer();
 		updateRenderer();
 
 
 	} );
 	} );
@@ -141,9 +141,14 @@ var SidebarProject = function ( editor ) {
 		5: 'ACESFilmic',
 		5: 'ACESFilmic',
 	} ).setWidth( '150px' ).onChange( function () {
 	} ).setWidth( '150px' ).onChange( function () {
 
 
-		config.setKey( 'project/renderer/toneMapping', this.getValue() );
+		var toneMapping = parseFloat( this.getValue() );
+		config.setKey( 'project/renderer/toneMapping', toneMapping );
 		updateRenderer();
 		updateRenderer();
 
 
+		// WebGLRenderer.whitePoint is only relevant for Uncharted2 tonemapping
+
+		toneMappingWhitePointRow.setDisplay( ( toneMapping === 3 ) ? 'block' : 'none' );
+
 	} );
 	} );
 	toneMappingSelect.setValue( config.getKey( 'project/renderer/toneMapping' ) );
 	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( new UIText( strings.getKey( 'sidebar/project/toneMappingWhitePoint' ) ).setWidth( '90px' ) );
 	toneMappingWhitePointRow.add( toneMappingWhitePoint );
 	toneMappingWhitePointRow.add( toneMappingWhitePoint );
 	rendererPanel.add( toneMappingWhitePointRow );
 	rendererPanel.add( toneMappingWhitePointRow );
+	toneMappingWhitePointRow.setDisplay( ( config.getKey( 'project/renderer/toneMapping' ) === 3 ? 'block' : 'none' ) );
 
 
 	//
 	//