Skip to content

Commit

Permalink
Examples: Refactored RoomEnvironment.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 20, 2020
1 parent 4650aa2 commit 56c1c01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 2 additions & 5 deletions examples/jsm/environments/RoomEnvironment.js
Expand Up @@ -6,7 +6,7 @@

import * as THREE from '../../../build/three.module.js';

function RoomEnvironment( renderer ) {
function RoomEnvironment() {

const scene = new THREE.Scene();

Expand Down Expand Up @@ -106,10 +106,7 @@ function RoomEnvironment( renderer ) {

}

let pmremGenerator = new THREE.PMREMGenerator( renderer );
let renderTarget = pmremGenerator.fromScene( scene );

return renderTarget.texture;
return scene;

}

Expand Down
5 changes: 4 additions & 1 deletion examples/webgl_materials_car.html
Expand Up @@ -77,9 +77,12 @@
controls.target.set( 0, 0.5, 0 );
controls.update();

var environment = new RoomEnvironment();
var pmremGenerator = new THREE.PMREMGenerator( renderer );

scene = new THREE.Scene();
scene.background = new THREE.Color( 0xeeeeee );
scene.environment = new RoomEnvironment( renderer );
scene.environment = pmremGenerator.fromScene( environment ).texture;
scene.fog = new THREE.Fog( 0xeeeeee, 10, 50 );

grid = new THREE.GridHelper( 100, 40, 0x000000, 0x000000 );
Expand Down

0 comments on commit 56c1c01

Please sign in to comment.