Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: all colors/textures washed out in r102 #15903

Closed
peteshea opened this issue Mar 4, 2019 · 9 comments · Fixed by #16148
Closed

Editor: all colors/textures washed out in r102 #15903

peteshea opened this issue Mar 4, 2019 · 9 comments · Fixed by #16148
Labels
Milestone

Comments

@peteshea
Copy link

peteshea commented Mar 4, 2019

In latest version of three.js/editor materials & textures are appearing very washed out as if overly lit or gamma set way too high. This occurs both with lit materials like Phong and with BASIC material with no lights in scene.

Existing scenes we have been using for prototyping & testing lighting now have very washed out looking textures/materials as of version r102.

Three.js version
  • [ x] r102 Editor
Browsers
  • [x ] Chrome
  • [x ] Firefox
OS
  • [ x] macOS
Hardware Requirements (graphics card, VR Device, ...)

Mac Book Pro OSX 10.11.6
2.8 GHz Intel Core i7
Intel HD Graphics 3000 512 MB

@Mugen87 Mugen87 added the Editor label Mar 4, 2019
@donmccurdy
Copy link
Collaborator

See #15858.

@mrdoob for gammaOutput=true to be a good default in the editor, we'll need more settings available or set by default:

  • color maps should use sRGB encoding
  • hex colors provided in the UI should be considered sRGB

Without that, I get different results dragging in a glTF model (which sets encoding correctly) as opposed to adding the texture through the Editor UI manually (which provides no option for this).

screen shot 2019-03-04 at 10 26 58 am

As discussed in #11337, I actually think both of the changes above would be beneficial to the library itself, not just the editor. But because that is a complex change, a temporary fix in the Editor – or reverting this change – may be needed.

@mrdoob
Copy link
Owner

mrdoob commented Mar 5, 2019

@donmccurdy

I think I would prefer keeping the current change but also implement:

  1. sRGB to Linear to sRGB conversion automatically in the UI.
  2. Treat maps as sRGB by default (except normal, etc)
  3. Script (either accessible from UI or pasteable in console) that fixes current scenes.

@mrdoob mrdoob changed the title [r102] three.js/editor gamma settings look incorrect- all textures washed out in latest Editor on Mac Editor: all colors/textures washed out in r102 Mar 5, 2019
@mrdoob mrdoob added this to the r103 milestone Mar 5, 2019
@donmccurdy
Copy link
Collaborator

donmccurdy commented Mar 5, 2019

Ok 👍

sRGB to Linear to sRGB conversion automatically in the UI.

I'd like to see this eventually be implicitly part of THREE.Color, perhaps with some colorManagement flag to disable it. When the user provides a hex code, it's implicitly sRGB, whereas fromArray() etc. would implicitly be linear. This will make it easier to match CSS colors and get more intuitive lighting values. The challenge is that some things are affected by gammaOutput (material.color) and others are not (fog.color, scene.background).

@WestLangley
Copy link
Collaborator

Just a few clarifications...

scene.background is currently affected by gammaOutput only if it is a texture.

gammaOutput will be renamed outputEncoding or outputColorSpace at some point.

@Usnul
Copy link
Contributor

Usnul commented Mar 9, 2019

I got caught out by this too. Still trying to figure out the whole color space conversion flow. It's a bit of a nightmare so far, trying to adapt my old ShaderMaterial. Would be nice if there was a bit of an explanation on this. Here's my trouble, might help others:
https://stackoverflow.com/questions/55077909/faded-color-in-shadermaterial-due-to-encoding-frament/55081355#55081355

@makc
Copy link
Contributor

makc commented Mar 27, 2019

@Usnul I assume RawShaderMaterial is not affected?

@mrdoob mrdoob modified the milestones: r103, r104 Mar 27, 2019
@Usnul
Copy link
Contributor

Usnul commented Mar 28, 2019

@Usnul I assume RawShaderMaterial is not affected?

That's correct, I haven't seen this issue in RawShaderMaterial. In fact, I have only seen this when trying to write ShaderMaterial using shader chunks from three.js

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 28, 2019

@Usnul This is the related question at stackoverflow, right?

https://stackoverflow.com/questions/55077909/washed-out-color-in-shadermaterial

@Usnul
Copy link
Contributor

Usnul commented Mar 28, 2019

@Mugen87 yeah, I still don't really understand what's going on there. My basic understanding is that there are interlocking hooks between pieces of standard material shader and the renderer itself so when you try to use them in a custom ShaderMaterial - things just don't work. One example is code injection for texture encoding mentioned in that stack-overflow post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants