-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Overview
Summary issue to organize and track progress toward offering a color-managed workflow in three.js. Loosely based on Maya's documentation, I'll define color management as follows:
Color management involves applying the appropriate transforms to convert between color spaces as needed. These transforms are applied at specific points along the initialization, rendering, and display processes. For example:
- On input, a transform is applied to convert colors and textures from the color space in which they were saved into the working color space.
- As you work, colors in the working color space may be converted to/from other color spaces in order to accommodate bit depth and precision considerations.
- On output to an image or display, an output transform is applied to convert colors appropriately for the image format or browser and device capabilities.
Roadmap
- (1.1) Add documentation of color management APIs (@donmccurdy)
- (1.2) Loaders identify and convert color spaces correctly (@gkjohnson)
- (1.3) Rename "encoding" properties more precisely as "colorSpace" (@donmccurdy + @Mugen87)
-
renderer.outputEncoding→renderer.outputColorSpace -
texture.encoding→texture.colorSpace
-
- (1.4) Change output color space default from Linear-sRGB to sRGB (@donmccurdy)
- (1.5) Convert some inputs automatically from sRGB to Linear-sRGB (@donmccurdy)
- hexadecimal and CSS inputs: Color: Add 'colorSpace' argument for getters/setters #23392
- (1.6) Change
texture.colorSpacedefault toTHREE.NoColorSpace(e.g. normal maps) - (1.7)
Ensure intermediate frame buffers have sufficient bit depth for their color space.See outputEncoding not handled correctly when using sRGB render target in WebGL2 #23251 (comment). No changes required. - (1.8) Let
CubeTextureLoaderreturn sRGB cube textures by default. - (1.9) Change
renderer.useLegacyLightsdefault tofalse
Timing considerations: If we are doing (1.3), (1.4), and (1.5), it would cause less disruption to existing code if we can make these changes within the same release. Fewer changes, if any, will be required for end-user code.
Future
These changes are more speculative, and may be considered explorative steps toward support for wide-gamut color spaces in WebGPU and SVG renderers.
- (2.1) Support changing
ColorManagement.workingColorSpace - (2.2) Support color input/output in Display P3 color space
- (3.3) Support vertex color workflow changes if necessary (
ColorBufferAttribute?)
Continued in #26479.