ソースを参照

add params for cubemap params (to support mobile)

Richard Monette 7 年 前
コミット
ad597c55d6

+ 3 - 3
examples/js/loaders/EquiangularToCubeGenerator.js

@@ -2,7 +2,7 @@
 * @author Richard M. / https://github.com/richardmonette
 */
 
-THREE.EquiangularToCubeGenerator = function ( sourceTexture, resolution ) {
+THREE.EquiangularToCubeGenerator = function ( sourceTexture, resolution, type, format ) {
 
 	this.sourceTexture = sourceTexture;
 	this.resolution = resolution;
@@ -23,10 +23,10 @@ THREE.EquiangularToCubeGenerator = function ( sourceTexture, resolution ) {
 	this.scene.add( this.boxMesh );
 
 	var params = {
-		format: THREE.RGBAFormat,
+		format: format ? format : this.sourceTexture.format,
 		magFilter: this.sourceTexture.magFilter,
 		minFilter: this.sourceTexture.minFilter,
-		type: this.sourceTexture.type,
+		type: type ? type : this.sourceTexture.type,
 		generateMipmaps: this.sourceTexture.generateMipmaps,
 		anisotropy: this.sourceTexture.anisotropy,
 		encoding: this.sourceTexture.encoding

+ 1 - 1
examples/webgl_materials_envmaps_exr.html

@@ -106,7 +106,7 @@
 					texture.magFilter = THREE.NearestFilter;
 					texture.encoding = THREE.LinearEncoding;
 
-					var cubemapGenerator = new THREE.EquiangularToCubeGenerator( texture, 512 );
+					var cubemapGenerator = new THREE.EquiangularToCubeGenerator( texture, 512, THREE.HalfFloatType );
 					var cubeMapTexture = cubemapGenerator.update( renderer );
 
 					var pmremGenerator = new THREE.PMREMGenerator( cubeMapTexture );