Skip to content

Commit

Permalink
Editor: Added modelviewer environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 12, 2021
1 parent 1e05a0d commit b2dde29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/js/Sidebar.Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ function SidebarScene( editor ) {
var environmentType = new UISelect().setOptions( {

'None': '',
'Background': 'Background'
'Background': 'Background',
'ModelViewer': 'ModelViewer'

} ).setWidth( '150px' );
environmentType.setValue( 'None' );
Expand Down
5 changes: 5 additions & 0 deletions editor/js/Viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { SetPositionCommand } from './commands/SetPositionCommand.js';
import { SetRotationCommand } from './commands/SetRotationCommand.js';
import { SetScaleCommand } from './commands/SetScaleCommand.js';

import { RoomEnvironment } from '../../examples/jsm/environments/RoomEnvironment.js';

function Viewport( editor ) {

var signals = editor.signals;
Expand Down Expand Up @@ -603,6 +605,9 @@ function Viewport( editor ) {
case 'Background':
scene.environment = pmremTexture;
break;
case 'ModelViewer':
scene.environment = pmremGenerator.fromScene( new RoomEnvironment() ).texture;
break;

}

Expand Down
2 changes: 2 additions & 0 deletions editor/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const assets = [
'../examples/jsm/curves/NURBSCurve.js',
'../examples/jsm/curves/NURBSUtils.js',

'../examples/jsm/environments/RoomEnvironment.js',

'../examples/jsm/exporters/ColladaExporter.js',
'../examples/jsm/exporters/DRACOExporter.js',
'../examples/jsm/exporters/GLTFExporter.js',
Expand Down

0 comments on commit b2dde29

Please sign in to comment.