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.

Washed out colors w/ color-encoding despite conversion

See original GitHub issue
Description of the problem

606daf2938efc1f282be99d4b4bc8e833b437064

left: threejs, right: figma - same rgb colors

gl.toneMapping = THREE.ACESFilmicToneMapping
gl.outputEncoding = THREE.sRGBEncoding

causes washed out colors despite converting them to linear color space

 new THREE.Color(color).convertSRGBToLinear()

And here is a reduced testcase: codesandbox

The outer ring should have the same color as the background (#fff9be), but it appears in a muddy gray. It works without filmic tonemapping, but now gamma is off and highlights blow out.

I’ve first posted on discourse (https://discourse.threejs.org/t/washed-out-colors-with-acesfilmic-despite-convertsrgbtolinear-and-srgbencoding/14080) to make sure that it’s not my fault, but it seems like a bug.

Three.js version
  • r115

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
donmccurdycommented, Apr 19, 2020

This is probably not a bug to be fixed, then, but here are some suggestions:

  1. There is a per-material material.toneMapped = false option. For specific objects where tonemapping is unnecessary and matching CSS content is important, that should be a good option. In particular, MeshBasicMaterial+.toneMapped=false would be a good choice for UI overlays.
  2. It might be useful to have additional functions like ColorUtils.convertFromToneMapping(color, ACESFilmicToneMapping) and convertToToneMapping. That would enable the workflow described above. Whether it’s a good workflow, I don’t know. 🙂
4reactions
donmccurdycommented, Apr 19, 2020

Yeah sorry, my reply on Discourse was probably incorrect. You can see the same effect in Blender:

Filmic: Screen Shot 2020-04-19 at 11 48 23 AM

Standard: Screen Shot 2020-04-19 at 11 48 31 AM

The sRGB→linear→sRGB conversion exists because the renderer operates on linear values; it is not intended to change a scene’s look, but to get the lighting math objectively correct for the specified colors. Tone mapping, on the other hand, is often used to change a scenes “look” and “mood”, and inherently does change colors.

I’m not sure what would be considered best practice, here, or if there is something we should change. If your workflow relies on Blender, where the default tonemapping is already Filmic, then you’ll get consistent results with Filmic in three.js. Presumably that’s the basic process for a fullscreen game. For webdev, where you need WebGL content to blend with the rest of the experience, you may want to alter three.js’ input colors so you get better perceived dynamic range while matching colors to the CSS content. That sounds reasonable to me but I’m not confident saying it’s best practice: in particular I wonder if it would exacerbate banding, and make dither more necessary, e.g. when applied to textures.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Washed out colors - Doom9's Forum
Washed out colors High Efficiency Video Coding (HEVC) ... Can someone give me a hint why the colors seem to change a bit...
Read more >
Why Your Video May Look Desaturated and Washed Out After ...
The problem with the video review turned out to be in the QuickTime ecosystem, which seems to be notorious for its funky color...
Read more >
My batch jpg resizer works with color images, but grayscale ...
It works great on color, but it has a problem with grayscale. The images are converted, but they become lighter and more washed...
Read more >
Jeffrey Friedl's Blog » Digital-Image Color Spaces, Page 3
Color printers use completely different color spaces — subtractive-color CYMK spaces rather than the additive-color RGB spaces that monitors use — so they...
Read more >
An Idiot's Guide to ACES – Toadstorm Nerdblog
I've been putting off working in ACES for years now, because almost ... The same exact scene, with the colors first converted to...
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