Skip to content

Commit

Permalink
Renderer: Use SRGBColorSpace for RGBA8 framebuffer target.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Jan 24, 2025
1 parent 2b6771e commit a9240fe
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1139,14 +1139,26 @@ class Renderer {
// to improve performance we only want to use HalfFloatType if necessary
// HalfFloatType is required when a) tone mapping is configured or b) the backend specifically requests it

const type = ( currentToneMapping !== NoToneMapping || this.backend.needsHalfFloatFrameBufferTarget() ) ? HalfFloatType : UnsignedByteType;
let type, colorSpace;

if ( currentToneMapping !== NoToneMapping || this.backend.needsHalfFloatFrameBufferTarget() ) {

type = HalfFloatType;
colorSpace = LinearSRGBColorSpace;

} else {

type = UnsignedByteType;
colorSpace = SRGBColorSpace;

}

frameBufferTarget = new RenderTarget( width, height, {
depthBuffer: depth,
stencilBuffer: stencil,
type: type,
format: RGBAFormat,
colorSpace: LinearSRGBColorSpace,
colorSpace: colorSpace,
generateMipmaps: false,
minFilter: LinearFilter,
magFilter: LinearFilter,
Expand Down

0 comments on commit a9240fe

Please sign in to comment.