diff --git a/docs/api/en/materials/MeshPhysicalMaterial.html b/docs/api/en/materials/MeshPhysicalMaterial.html index 8d45d51975e27d..f840341e8049d2 100644 --- a/docs/api/en/materials/MeshPhysicalMaterial.html +++ b/docs/api/en/materials/MeshPhysicalMaterial.html @@ -188,9 +188,7 @@

[property:Float transmission]

The transmission property can be used to model these materials.
- When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.
- - This feature can only be used with a WebGL 2 rendering context. + When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.

[property:Texture transmissionMap]

diff --git a/docs/api/zh/materials/MeshPhysicalMaterial.html b/docs/api/zh/materials/MeshPhysicalMaterial.html index de6a952535affe..46ea81744ae8dc 100644 --- a/docs/api/zh/materials/MeshPhysicalMaterial.html +++ b/docs/api/zh/materials/MeshPhysicalMaterial.html @@ -184,9 +184,7 @@

[property:Float transmission]

The transmission property can be used to model these materials.
- When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.
- - This feature can only be used with a WebGL 2 rendering context. + When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.

[property:Texture transmissionMap]

diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 9472e1a53bbfef..f2828ff7ce0d0c 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -9,6 +9,7 @@ import { UnsignedByteType, LinearEncoding, NoToneMapping, + LinearFilter, LinearMipmapLinearFilter } from '../constants.js'; import { Frustum } from '../math/Frustum.js'; @@ -1184,29 +1185,22 @@ function WebGLRenderer( parameters = {} ) { function renderTransmissionPass( opaqueObjects, scene, camera ) { - if ( capabilities.isWebGL2 === false ) { - - console.error( 'THREE.WebGLRenderer: Transmission can only be used with WebGL 2.' ); - return; - - } + const isWebGL2 = capabilities.isWebGL2; if ( _transmissionRenderTarget === null ) { - const renderTargetType = ( _antialias === true ) ? WebGLMultisampleRenderTarget : WebGLRenderTarget; + const renderTargetType = ( isWebGL2 && _antialias === true ) ? WebGLMultisampleRenderTarget : WebGLRenderTarget; _transmissionRenderTarget = new renderTargetType( 1, 1, { generateMipmaps: true, type: HalfFloatType, - minFilter: LinearMipmapLinearFilter, + minFilter: isWebGL2 ? LinearMipmapLinearFilter : LinearFilter, useRenderToTexture: extensions.has( 'WEBGL_multisampled_render_to_texture' ) } ); } - // set size of transmission render target to half size of drawing buffer - - _this.getDrawingBufferSize( _vector2 ).multiplyScalar( 0.5 ).floor(); + _this.getDrawingBufferSize( _vector2 ); _transmissionRenderTarget.setSize( _vector2.x, _vector2.y ); //