Skip to content

Commit

Permalink
WebGLTextures: WebGL2 framebuffer RGBformat fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
sciecode committed Mar 10, 2020
1 parent 4b341a7 commit 98114a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/renderers/webgl/WebGLTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,18 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );
var supportsMips = isPowerOfTwo( renderTarget ) || isWebGL2;

// Handles WebGL2 RGBFormat fallback - #18858

if ( isWebGL2 &&
renderTarget.texture.format === RGBFormat &&
( renderTarget.texture.type === FloatType || renderTarget.texture.type === HalfFloatType ) ) {

renderTarget.texture.format = RGBAFormat;

console.warn( 'THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.' );

}

// Setup framebuffer

if ( isCube ) {
Expand Down

0 comments on commit 98114a1

Please sign in to comment.