提交 ad597c55 编写于 作者: R Richard Monette

add params for cubemap params (to support mobile)

上级 f36c9c59
......@@ -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
......
......@@ -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 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册