Skip to content

Commit

Permalink
Examples: Add RoomEnvironment to alpha hash example (#26344)
Browse files Browse the repository at this point in the history
* Examples: Add RoomEnvironment to alpha hash example.

* Bump screenshot

* Add useLegacyLights=false

* Add alpha hash to exception list
  • Loading branch information
donmccurdy authored Jun 29, 2023
1 parent c141369 commit 21e57f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Binary file modified examples/screenshots/webgl_materials_alphahash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions examples/webgl_materials_alphahash.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import Stats from 'three/addons/libs/stats.module.js';
import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';

import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
Expand Down Expand Up @@ -62,10 +63,6 @@

scene = new THREE.Scene();

const light = new THREE.HemisphereLight( 0xffffff, 0x888888 );
light.position.set( 0, 1, 0 );
scene.add( light );

const geometry = new THREE.IcosahedronGeometry( 0.5, 3 );

material = new THREE.MeshStandardMaterial( {
Expand Down Expand Up @@ -107,10 +104,19 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

//

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

scene.environment = pmremGenerator.fromScene( environment ).texture;
environment.dispose();

//

composer = new EffectComposer( renderer );

renderPass = new RenderPass( scene, camera );
Expand Down
1 change: 1 addition & 0 deletions test/e2e/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const exceptionList = [
'webgl_loader_imagebitmap',
'webgl_loader_texture_lottie',
'webgl_loader_texture_pvrtc',
'webgl_materials_alphahash',
'webgl_materials_blending',
'webgl_mirror',
'webgl_morphtargets_face',
Expand Down

0 comments on commit 21e57f6

Please sign in to comment.