Explorar o código

Editor: Add backgroundBlurriness support. (#24783)

Michael Herzog %!s(int64=2) %!d(string=hai) anos
pai
achega
f5c738c95a
Modificáronse 2 ficheiros con 14 adicións e 2 borrados
  1. 12 1
      editor/js/Sidebar.Scene.js
  2. 2 1
      editor/js/Viewport.js

+ 12 - 1
editor/js/Sidebar.Scene.js

@@ -185,13 +185,23 @@ function SidebarScene( editor ) {
 
 
 	container.add( backgroundRow );
 	container.add( backgroundRow );
 
 
+	const backgroundEquirectRow = new UIRow();
+	backgroundEquirectRow.setDisplay( 'none' );
+	backgroundEquirectRow.setMarginLeft( '90px' );
+
+	const backgroundBlurriness = new UINumber( 0 ).setWidth( '40px' ).setRange( 0, 1 ).onChange( onBackgroundChanged );
+	backgroundEquirectRow.add( backgroundBlurriness );
+
+	container.add( backgroundEquirectRow );
+
 	function onBackgroundChanged() {
 	function onBackgroundChanged() {
 
 
 		signals.sceneBackgroundChanged.dispatch(
 		signals.sceneBackgroundChanged.dispatch(
 			backgroundType.getValue(),
 			backgroundType.getValue(),
 			backgroundColor.getHexValue(),
 			backgroundColor.getHexValue(),
 			backgroundTexture.getValue(),
 			backgroundTexture.getValue(),
-			backgroundEquirectangularTexture.getValue()
+			backgroundEquirectangularTexture.getValue(),
+			backgroundBlurriness.getValue()
 		);
 		);
 
 
 	}
 	}
@@ -204,6 +214,7 @@ function SidebarScene( editor ) {
 		backgroundColor.setDisplay( type === 'Color' ? '' : 'none' );
 		backgroundColor.setDisplay( type === 'Color' ? '' : 'none' );
 		backgroundTexture.setDisplay( type === 'Texture' ? '' : 'none' );
 		backgroundTexture.setDisplay( type === 'Texture' ? '' : 'none' );
 		backgroundEquirectangularTexture.setDisplay( type === 'Equirectangular' ? '' : 'none' );
 		backgroundEquirectangularTexture.setDisplay( type === 'Equirectangular' ? '' : 'none' );
+		backgroundEquirectRow.setDisplay( type === 'Equirectangular' ? '' : 'none' );
 
 
 	}
 	}
 
 

+ 2 - 1
editor/js/Viewport.js

@@ -481,7 +481,7 @@ function Viewport( editor ) {
 
 
 	// background
 	// background
 
 
-	signals.sceneBackgroundChanged.add( function ( backgroundType, backgroundColor, backgroundTexture, backgroundEquirectangularTexture ) {
+	signals.sceneBackgroundChanged.add( function ( backgroundType, backgroundColor, backgroundTexture, backgroundEquirectangularTexture, backgroundBlurriness ) {
 
 
 		switch ( backgroundType ) {
 		switch ( backgroundType ) {
 
 
@@ -513,6 +513,7 @@ function Viewport( editor ) {
 
 
 					backgroundEquirectangularTexture.mapping = THREE.EquirectangularReflectionMapping;
 					backgroundEquirectangularTexture.mapping = THREE.EquirectangularReflectionMapping;
 					scene.background = backgroundEquirectangularTexture;
 					scene.background = backgroundEquirectangularTexture;
+					scene.backgroundBlurriness = backgroundBlurriness;
 
 
 				}
 				}