提交 b5145051 编写于 作者: B Ben Houston

pick a good default PMREMGenerator cube size, and allow it to be overriden.

上级 3606d2f4
......@@ -11,27 +11,10 @@
* by this class.
*/
THREE.PMREMGenerator = function( sourceTexture ) {
if ( sourceTexture instanceof THREE.CubeTexture ) {
THREE.PMREMGenerator = function( sourceTexture, resolution ) {
if ( sourceTexture.images[ 0 ] === undefined )
console.error( "sourceTexture Not Initialized" );
if(sourceTexture.images[ 0 ] instanceof THREE.DataTexture) {
this.resolution = sourceTexture.images[ 0 ].image.width;
}
else {
this.resolution = sourceTexture.images[ 0 ].width;
}
}
else if ( sourceTexture instanceof THREE.WebGLRenderTargetCube ) {
if ( sourceTexture === undefined ) console.error( "Render Target Not Initialized" );
this.resolution = sourceTexture.width;
}
else {
console.error( "Wrong Input to PMREMGenerator" );
}
this.sourceTexture = sourceTexture;
this.resolution = ( resolution !== undefined ) ? resolution : 256;
var monotonicEncoding = ( sourceTexture.encoding === THREE.LinearEncoding ) ||
( sourceTexture.encoding === THREE.GammaEncoding ) || ( sourceTexture.encoding === THREE.sRGBEncoding );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册