@@ -154,6 +154,12 @@ export abstract class Pass<TMaterial extends Material | null = null>
154154
155155 private _autoSyncDefaultBuffers : boolean ;
156156
157+ /**
158+ * @see {@link autoSRGB }
159+ */
160+
161+ private _autoSRGB : boolean ;
162+
157163 /**
158164 * @see {@link timer }
159165 */
@@ -258,6 +264,7 @@ export abstract class Pass<TMaterial extends Material | null = null>
258264 this . _enabled = true ;
259265 this . _attached = false ;
260266 this . _autoSyncDefaultBuffers = true ;
267+ this . _autoSRGB = true ;
261268 this . _renderer = null ;
262269 this . _timer = null ;
263270 this . _scene = null ;
@@ -369,6 +376,29 @@ export abstract class Pass<TMaterial extends Material | null = null>
369376
370377 }
371378
379+ /**
380+ * Controls automatic sRGB encoding for low precision output buffers.
381+ *
382+ * @defaultValue true
383+ */
384+
385+ protected get autoSRGB ( ) : boolean {
386+
387+ return this . _autoSRGB ;
388+
389+ }
390+
391+ protected set autoSRGB ( value : boolean ) {
392+
393+ if ( this . _autoSRGB !== value ) {
394+
395+ this . _autoSRGB = value ;
396+ this . syncDefaultBuffers ( ) ;
397+
398+ }
399+
400+ }
401+
372402 /**
373403 * A list of subpasses.
374404 *
@@ -828,9 +858,13 @@ export abstract class Pass<TMaterial extends Material | null = null>
828858 }
829859
830860 // If the output buffer uses low precision, enable sRGB encoding to reduce information loss.
831- const useSRGBFramebuffer = ! this . output . frameBufferPrecisionHigh && renderer . outputColorSpace === SRGBColorSpace ;
861+ const useSRGB = (
862+ this . autoSRGB &&
863+ ! this . output . frameBufferPrecisionHigh &&
864+ renderer . outputColorSpace === SRGBColorSpace
865+ ) ;
832866
833- if ( useSRGBFramebuffer && texture . colorSpace !== SRGBColorSpace ) {
867+ if ( useSRGB && texture . colorSpace !== SRGBColorSpace ) {
834868
835869 texture . colorSpace = SRGBColorSpace ;
836870 texture . needsUpdate = true ;
0 commit comments