Skip to content

Commit a9240fe

Browse files
committed
Renderer: Use SRGBColorSpace for RGBA8 framebuffer target.
1 parent 2b6771e commit a9240fe

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/renderers/common/Renderer.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,14 +1139,26 @@ class Renderer {
11391139
// to improve performance we only want to use HalfFloatType if necessary
11401140
// HalfFloatType is required when a) tone mapping is configured or b) the backend specifically requests it
11411141

1142-
const type = ( currentToneMapping !== NoToneMapping || this.backend.needsHalfFloatFrameBufferTarget() ) ? HalfFloatType : UnsignedByteType;
1142+
let type, colorSpace;
1143+
1144+
if ( currentToneMapping !== NoToneMapping || this.backend.needsHalfFloatFrameBufferTarget() ) {
1145+
1146+
type = HalfFloatType;
1147+
colorSpace = LinearSRGBColorSpace;
1148+
1149+
} else {
1150+
1151+
type = UnsignedByteType;
1152+
colorSpace = SRGBColorSpace;
1153+
1154+
}
11431155

11441156
frameBufferTarget = new RenderTarget( width, height, {
11451157
depthBuffer: depth,
11461158
stencilBuffer: stencil,
11471159
type: type,
11481160
format: RGBAFormat,
1149-
colorSpace: LinearSRGBColorSpace,
1161+
colorSpace: colorSpace,
11501162
generateMipmaps: false,
11511163
minFilter: LinearFilter,
11521164
magFilter: LinearFilter,

0 commit comments

Comments
 (0)