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

more work on PMREM

上级 4051cb6d
...@@ -24,17 +24,12 @@ ...@@ -24,17 +24,12 @@
else { else {
console.error( "Wrong Input to PMREMGenerator" ); console.error( "Wrong Input to PMREMGenerator" );
} }
this.sourceTexture = cubeTexture; 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 = []; this.cubeLods = [];
var size = this.resolution; 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; this.numLods = Math.log2( size ) - 2;
for ( var i = 0; i < this.numLods; i ++ ) { for ( var i = 0; i < this.numLods; i ++ ) {
...@@ -89,8 +84,7 @@ THREE.PMREMGenerator.prototype = { ...@@ -89,8 +84,7 @@ THREE.PMREMGenerator.prototype = {
}, },
renderToCubeMapTargetFace: function( renderer, renderTarget, faceIndex ) { renderToCubeMapTargetFace: function( renderer, renderTarget, faceIndex ) {
console.log( 'renderTarget', renderTarget );
renderTarget.texture.generateMipmaps = false;
renderTarget.activeCubeFace = faceIndex; renderTarget.activeCubeFace = faceIndex;
this.shader.uniforms[ "faceIndex" ].value = faceIndex; this.shader.uniforms[ "faceIndex" ].value = faceIndex;
renderer.render( this.scene, this.camera, renderTarget, true ); renderer.render( this.scene, this.camera, renderTarget, true );
......
...@@ -117,6 +117,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) { ...@@ -117,6 +117,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
} }
} }
console.log( "renderer.getCurrentRenderTarget()", renderer.getCurrentRenderTarget() );
var parameters = { var parameters = {
shaderID: shaderID, shaderID: shaderID,
...@@ -180,7 +181,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) { ...@@ -180,7 +181,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
flipSided: material.side === THREE.BackSide flipSided: material.side === THREE.BackSide
}; };
console.log( 'parameters', parameters );
return parameters; return parameters;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册