Skip to content

Commit

Permalink
Editor: Store equirectangular environment (#22187)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob authored Jul 26, 2021
1 parent 9c964a0 commit 9afaec0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
signals.objectRemoved.add( saveState );
signals.materialChanged.add( saveState );
signals.sceneBackgroundChanged.add( saveState );
signals.sceneEnvironmentChanged.add( saveState );
signals.sceneFogChanged.add( saveState );
signals.sceneGraphChanged.add( saveState );
signals.scriptChanged.add( saveState );
Expand Down
1 change: 1 addition & 0 deletions editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Editor.prototype = {
this.scene.name = scene.name;

this.scene.background = scene.background;
this.scene.environment = scene.environment;
this.scene.fog = scene.fog;

this.scene.userData = JSON.parse( JSON.stringify( scene.userData ) );
Expand Down
8 changes: 7 additions & 1 deletion editor/js/Sidebar.Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,12 @@ function SidebarScene( editor ) {

if ( scene.environment ) {

// TODO
if ( scene.environment.mapping === THREE.EquirectangularReflectionMapping ) {

environmentType.setValue( 'Equirectangular' );
environmentEquirectangularTexture.setValue( scene.environment );

}

} else {

Expand Down Expand Up @@ -434,6 +439,7 @@ function SidebarScene( editor ) {
}

refreshBackgroundUI();
refreshEnvironmentUI();
refreshFogUI();

}
Expand Down
2 changes: 1 addition & 1 deletion editor/js/libs/ui.three.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UITexture extends UISpan {

// assuming RGBE/Radiance HDR iamge format

const loader = new RGBELoader().setDataType( THREE.UnsignedByteType );
const loader = new RGBELoader().setDataType( THREE.FloatType );
loader.load( event.target.result, function ( hdrTexture ) {

hdrTexture.sourceFile = file.name;
Expand Down

0 comments on commit 9afaec0

Please sign in to comment.