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

more work on PMREM

上级 4051cb6d
......@@ -24,17 +24,12 @@
else {
console.error( "Wrong Input to PMREMGenerator" );
}
this.sourceTexture = cubeTexture;
// encoded formats do not interpolate well, thus turn off interpolation for them
var textureFilter = ( this.sourceTexture.encoding === THREE.LinearEncoding ) ? THREE.LinearFilter : THREE.NearestFilter;
this.sourceTexture.minFilter = this.sourceTexture.magFilter = textureFilter;
this.cubeLods = [];
var size = this.resolution;
var params = { format: THREE.RGBAFormat, magFilter: textureFilter, minFilter: textureFilter, type: this.sourceTexture.type };
var params = { format: this.sourceTexture.format, magFilter: this.sourceTexture.magFilter, minFilter: this.sourceTexture.minFilter, type: this.sourceTexture.type };
this.numLods = Math.log2( size ) - 2;
for ( var i = 0; i < this.numLods; i ++ ) {
......@@ -89,8 +84,7 @@ THREE.PMREMGenerator.prototype = {
},
renderToCubeMapTargetFace: function( renderer, renderTarget, faceIndex ) {
renderTarget.texture.generateMipmaps = false;
console.log( 'renderTarget', renderTarget );
renderTarget.activeCubeFace = faceIndex;
this.shader.uniforms[ "faceIndex" ].value = faceIndex;
renderer.render( this.scene, this.camera, renderTarget, true );
......
......@@ -117,6 +117,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
}
}
console.log( "renderer.getCurrentRenderTarget()", renderer.getCurrentRenderTarget() );
var parameters = {
shaderID: shaderID,
......@@ -180,7 +181,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
flipSided: material.side === THREE.BackSide
};
console.log( 'parameters', parameters );
return parameters;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册