-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
ColorManagement: Add ColorManagement.define( { ... } ) #29450
ColorManagement: Add ColorManagement.define( { ... } ) #29450
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
With the exception of SRGB, wide gamut can we perform color space conversions just using matrix multiplication? |
Thanks @sunag! Yes, we can convert from any supported RGB color space "A" to "B" with the same structure:
If either A or B is a ”linear” space, its transfer function is a no-op, and that step can be skipped. So conversion between two linear spaces would just be a matrix multiplication. For now the only transfer functions we need to care about today are the “sRGB” transfer functions, (our LinearToSRGB and SRGBToLinear functions), shared by sRGB and Display P3 color spaces. Perhaps we'll need a few more transfer functions someday, but probably not soon. |
@WestLangley @Mugen87 with r169 out now, I'd love to merge this early in the month for r170 if possible – do you see any concerns? I don't feel strongly that Display P3 needs to be moved to /cc @gkjohnson FYI |
Related issue: #29259 (comment)
Adds support for loading color space definitions from
three/addons/...
, and for user-supplied color space definitions. As the web platform adds support for wide gamut and “HDR” color spaces, this change is intended to allow more experimentation and flexible color workflows. Transfer functions are predefined at this time, and cannot be added dynamically.Example:
Notable changes:
three/addons
and LinearRec2100DisplayColorSpaceare added tothree/addons
ColorManagement.workingColorSpace
are removed; support for anything other than LinearSRGBColorSpace should be considered 'experimental'