|
@@ -987,6 +987,18 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );
|
|
var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );
|
|
var supportsMips = isPowerOfTwo( renderTarget ) || isWebGL2;
|
|
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
|
|
// Setup framebuffer
|
|
|
|
|
|
if ( isCube ) {
|
|
if ( isCube ) {
|