Skip to content

Commit 4659fb2

Browse files
committed
Merge pull request mrdoob#8363 from bhouston/pmrem_default_size
Fix PMREM cubemap size at 256 for performance reasons
2 parents 63f8678 + a6fdafa commit 4659fb2

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

examples/js/pmrem/PMREMGenerator.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,10 @@
1111
* by this class.
1212
*/
1313

14-
THREE.PMREMGenerator = function( sourceTexture ) {
15-
if ( sourceTexture instanceof THREE.CubeTexture ) {
14+
THREE.PMREMGenerator = function( sourceTexture ) {
1615

17-
if ( sourceTexture.images[ 0 ] === undefined )
18-
console.error( "sourceTexture Not Initialized" );
19-
if(sourceTexture.images[ 0 ] instanceof THREE.DataTexture) {
20-
this.resolution = sourceTexture.images[ 0 ].image.width;
21-
}
22-
else {
23-
this.resolution = sourceTexture.images[ 0 ].width;
24-
}
25-
26-
}
27-
else if ( sourceTexture instanceof THREE.WebGLRenderTargetCube ) {
28-
if ( sourceTexture === undefined ) console.error( "Render Target Not Initialized" );
29-
this.resolution = sourceTexture.width;
30-
}
31-
else {
32-
console.error( "Wrong Input to PMREMGenerator" );
33-
}
3416
this.sourceTexture = sourceTexture;
17+
this.resolution = 256; // NODE: 256 is currently hard coded in the glsl code for performance reasons
3518

3619
var monotonicEncoding = ( sourceTexture.encoding === THREE.LinearEncoding ) ||
3720
( sourceTexture.encoding === THREE.GammaEncoding ) || ( sourceTexture.encoding === THREE.sRGBEncoding );

0 commit comments

Comments
 (0)