Skip to content

Commit

Permalink
Merge branch 'cubemap-param-overrides' of https://github.com/richardm…
Browse files Browse the repository at this point in the history
…onette/three.js into dev

# Conflicts:
#	examples/js/loaders/EquirectangularToCubeGenerator.js
#	examples/webgl_materials_envmaps_exr.html
  • Loading branch information
mrdoob committed Aug 30, 2018
2 parents 21f67da + 94743d1 commit f08d22f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/js/loaders/EquirectangularToCubeGenerator.js
Expand Up @@ -2,10 +2,10 @@
* @author Richard M. / https://github.com/richardmonette
*/

THREE.EquirectangularToCubeGenerator = function ( sourceTexture, resolution ) {
THREE.EquirectangularToCubeGenerator = function ( sourceTexture, options ) {

this.sourceTexture = sourceTexture;
this.resolution = resolution;
this.resolution = options.resolution || 512;

this.views = [
{ t: [ 1, 0, 0 ], u: [ 0, - 1, 0 ] },
Expand All @@ -23,10 +23,10 @@ THREE.EquirectangularToCubeGenerator = function ( sourceTexture, resolution ) {
this.scene.add( this.boxMesh );

var params = {
format: THREE.RGBAFormat,
format: options.format || this.sourceTexture.format,
magFilter: this.sourceTexture.magFilter,
minFilter: this.sourceTexture.minFilter,
type: this.sourceTexture.type,
type: options.type || this.sourceTexture.type,
generateMipmaps: this.sourceTexture.generateMipmaps,
anisotropy: this.sourceTexture.anisotropy,
encoding: this.sourceTexture.encoding
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_materials_envmaps_exr.html
Expand Up @@ -106,7 +106,7 @@
texture.magFilter = THREE.NearestFilter;
texture.encoding = THREE.LinearEncoding;

var cubemapGenerator = new THREE.EquirectangularToCubeGenerator( texture, 512 );
var cubemapGenerator = new THREE.EquirectangularToCubeGenerator( texture, { resolution: 512, type: THREE.HalfFloatType } );
var cubeMapTexture = cubemapGenerator.update( renderer );

var pmremGenerator = new THREE.PMREMGenerator( cubeMapTexture );
Expand Down

0 comments on commit f08d22f

Please sign in to comment.