diff --git a/examples/webgl_loader_texture_hdrjpg.html b/examples/webgl_loader_texture_hdrjpg.html index 654f1b8e695aac..e70fb7ca7985c2 100644 --- a/examples/webgl_loader_texture_hdrjpg.html +++ b/examples/webgl_loader_texture_hdrjpg.html @@ -134,9 +134,9 @@ resolutions[ 'HDR JPG' ] = hdrJpg.width + 'x' + hdrJpg.height; displayStats( 'HDR JPG' ); - hdrJpgPMREMRenderTarget = pmremGenerator.fromEquirectangular( hdrJpg.renderTarget.texture ); + hdrJpgEquirectangularMap = hdrJpg.renderTarget.texture; + hdrJpgPMREMRenderTarget = pmremGenerator.fromEquirectangular( hdrJpgEquirectangularMap ); - hdrJpgEquirectangularMap = hdrJpg.toDataTexture(); hdrJpgEquirectangularMap.mapping = THREE.EquirectangularReflectionMapping; hdrJpgEquirectangularMap.minFilter = THREE.LinearFilter; hdrJpgEquirectangularMap.magFilter = THREE.LinearFilter; @@ -159,9 +159,9 @@ resolutions[ 'Webp Gain map (separate)' ] = gainMap.width + 'x' + gainMap.height; - gainMapPMREMRenderTarget = pmremGenerator.fromEquirectangular( gainMap.renderTarget.texture ); + gainMapBackground = hdrJpg.renderTarget.texture; + gainMapPMREMRenderTarget = pmremGenerator.fromEquirectangular( gainMapBackground ); - gainMapBackground = gainMap.toDataTexture(); gainMapBackground.mapping = THREE.EquirectangularReflectionMapping; gainMapBackground.minFilter = THREE.LinearFilter; gainMapBackground.magFilter = THREE.LinearFilter; @@ -285,11 +285,11 @@ case 'HDR JPG': pmremRenderTarget = hdrJpgPMREMRenderTarget; - equirectangularMap = hdrJpgEquirectangularMap || hdrJpg.renderTarget.texture; + equirectangularMap = hdrJpgEquirectangularMap; break; case 'Webp Gain map (separate)': pmremRenderTarget = gainMapPMREMRenderTarget; - equirectangularMap = gainMapBackground || gainMap.renderTarget.texture; + equirectangularMap = gainMapBackground; break; case 'HDR': pmremRenderTarget = hdrPMREMRenderTarget; @@ -302,9 +302,6 @@ if ( newEnvMap && newEnvMap !== torusMesh.material.envMap ) { - torusMesh.material.envMap = newEnvMap; - torusMesh.material.needsUpdate = true; - planeMesh.material.map = newEnvMap; planeMesh.material.needsUpdate = true; @@ -313,6 +310,7 @@ torusMesh.rotation.y += 0.005; planeMesh.visible = params.debug; + scene.environment = equirectangularMap; scene.background = equirectangularMap; renderer.toneMappingExposure = params.exposure; diff --git a/src/renderers/webgl/WebGLCubeMaps.js b/src/renderers/webgl/WebGLCubeMaps.js index f02d4237742ff1..f984ab620594d5 100644 --- a/src/renderers/webgl/WebGLCubeMaps.js +++ b/src/renderers/webgl/WebGLCubeMaps.js @@ -23,7 +23,7 @@ function WebGLCubeMaps( renderer ) { function get( texture ) { - if ( texture && texture.isTexture && texture.isRenderTargetTexture === false ) { + if ( texture && texture.isTexture ) { const mapping = texture.mapping;