question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebGLRenderTarget: Inconsistent output with UnsignedByteType + sRGBEncoding

See original GitHub issue

Describe the bug

Using WebGLRenderTarget in a post-processing stack with .type=UnsignedByteType and .encoding=sRGBEncoding causes incorrect final output to canvas:

type encoding result
uint8 Linear-sRGB uint8_linear
float16 Linear-sRGB float16_linear
uint8 sRGB uint8_srgb
float16 sRGB float16_srgb

More interestingly, the uint8/srgb output flickers on my device — sometimes showing the expected color for a frame, but mostly showing the incorrect color. Reports in Discord suggest this issue may be specific to macOS devices with M1 chips.

To Reproduce

Expected behavior

Same background color as with other render target settings.

Platform:

  • Device: Desktop
  • OS: macOS Monterey 12.3.1
  • GPU: Apple M1 Pro
  • Browser:
    • ✅ Safari (OK)
    • ❌ Chrome (BROKEN)
    • ❌ Firefox (BROKEN)
  • Three.js version: r140

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
donmccurdycommented, May 25, 2022
1reaction
donmccurdycommented, May 4, 2022

/cc @vanruesc FYI

Read more comments on GitHub >

github_iconTop Results From Across the Web

Non-smooth Points 'sizeAttenuation' on M1 Macbooks #23968
Describe the bug Specifically on M1-based Macbooks, in non-safari browsers (as far as testing has gone), the size attenuation of points does ...
Read more >
sRGBEncoding in not working in THREE.EffectComposer
When using post processing, use a gamma correction pass at the end of your pass chain. This will ensure a sRGB encoded output:...
Read more >
Color management in three.js - Don McCurdy
Hexadecimal and CSS colors are generally sRGB, and must be converted. Renderer should have .outputEncoding = sRGBEncoding when not using post- ...
Read more >
WebGLRenderTarget – three.js docs
A render target is a buffer where the video card draws pixels for a scene that is being rendered in the background. It...
Read more >
UNPKG - @google/model-viewer
n * @param selector A string which filters the results to elements that match\n ... LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst GammaEncoding ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found