Kaynağa Gözat

Fixed support for multisampled rendering when render to texture is unsupported (#23145)

* Update default foveation

* Fixed support for multisampled rendering when render to texture is unsupported
Rik Cabanier 3 yıl önce
ebeveyn
işleme
0311f8f0cb
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. 7 0
      src/renderers/webxr/WebXRManager.js

+ 7 - 0
src/renderers/webxr/WebXRManager.js

@@ -13,6 +13,7 @@ import {
 	DepthStencilFormat,
 	DepthStencilFormat,
 	RGBAFormat,
 	RGBAFormat,
 	RGBFormat,
 	RGBFormat,
+	sRGBEncoding,
 	UnsignedByteType,
 	UnsignedByteType,
 	UnsignedShortType,
 	UnsignedShortType,
 	UnsignedInt248Type,
 	UnsignedInt248Type,
@@ -286,6 +287,12 @@ class WebXRManager extends EventDispatcher {
 						scaleFactor: framebufferScaleFactor
 						scaleFactor: framebufferScaleFactor
 					};
 					};
 
 
+					if ( renderer.outputEncoding === sRGBEncoding ) {
+
+						projectionlayerInit.colorFormat = ( attributes.alpha || isMultisample ) ? gl.SRGB8_ALPHA8 : gl.SRGB8;
+
+					}
+
 					glBinding = new XRWebGLBinding( session, gl );
 					glBinding = new XRWebGLBinding( session, gl );
 
 
 					glProjLayer = glBinding.createProjectionLayer( projectionlayerInit );
 					glProjLayer = glBinding.createProjectionLayer( projectionlayerInit );