blender/intern
Lukas Stockner 6967255906 Color management: Support white balance as part of the display transform
This implements a von-Kries-style chromatic adaption using the Bradford matrix.
The adaption is performed in scene linear space in the OCIO GLSL shader, with
the matrix being computed on the host.

The parameters specify the white point of the input, which is to be mapped to
the white point of the scene linear space. The main parameter is temperature,
specified in Kelvin, which defines the blackbody spectrum that is used as the
input white point. Additionally, a tint parameter can be used to shift the
white point away from pure blackbody spectra (e.g. to match a D illuminant).

The defaults are set to match D65 so there is no immediate color shift when
enabling the option. Tint = 10 is needed since the D-series illuminants aren't
perfect blackbody emitters.

As an alternative to manually specifying the values, there's also a color
picker. When a color is selected, temperature and tint are set such that this
color ends up being balanced to white.
This only works if the color is close enough to a blackbody emitter -
specifically, for tint values within +-150. Beyond this, there can be ambiguity
in the representation.
Currently, in this case, the input is just ignored and temperature/tint aren't
changed. Ideally, we'd eventually give UI feedback for this.

Presets are supported, and all the CIE standard illuminants are included.

One part that I'm not quite happy with is that the tint parameter starts to
give weird results at moderate values when the temperature is low.
The reason for this can be seen here:
https://commons.wikimedia.org/wiki/File:Planckian-locus.png
Tint is moving along the isotherm lines (with the plot corresponding to +-150),
but below 4000K some of that range is outside of the gamut. Not much can
be done there, other than possibly clipping those values...

Adding support for this to the compositor should be quite easy and is planned
as a next step.

Pull Request: https://projects.blender.org/blender/blender/pulls/123278
2024-06-27 23:27:58 +02:00
..
atomic Cleanup: move CMake test utility functions into testing.cmake 2024-01-03 14:49:11 +01:00
audaspace Cleanup: use braces for sources in intern/ 2023-09-17 09:05:40 +10:00
clog Cleanup: match function/declaration names 2024-04-17 11:36:36 +10:00
cycles Merge branch 'blender-v4.2-release' 2024-06-26 21:30:39 +02:00
dualcon Mesh: Rename MLoopTri variable names, and functions 2023-12-19 14:57:49 +01:00
eigen Cleanup: remove redundant define checks 2023-12-07 10:39:03 +11:00
ffmpeg Tests: add option to build one binary per GTest file 2024-01-03 18:35:50 +01:00
ghost Merge branch 'blender-v4.2-release' 2024-06-26 11:50:27 +02:00
guardedalloc Fix (unreported) 'copy' version of MEM_cnew not handling alignment. 2024-06-20 11:00:34 +02:00
iksolver Clang Format: bump to version 17 2024-01-03 13:38:14 +01:00
itasc Fix #120763: Fix memory leak in itasc cache 2024-04-24 09:35:04 +02:00
libc_compat Build: fix linking FFMPEG & x265 on Linux 2024-06-15 14:15:53 +10:00
libmv UI: fix and improve a few messages 2024-02-05 17:08:17 +01:00
locale License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
mantaflow Cleanup: remove redundant variables & assignments 2024-04-09 13:52:41 +10:00
memutil Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
mikktspace Cleanup: Mikktspace: use sqrtf() function with float type 2024-06-04 14:27:17 +02:00
opencolorio Color management: Support white balance as part of the display transform 2024-06-27 23:27:58 +02:00
opensubdiv Subdiv: Make OpenSubdiv_TopologyRefiner into a C++ class 2024-04-19 09:03:48 -04:00
openvdb Cleanup: spelling in code comments & minor edits 2024-06-06 09:55:13 +10:00
quadriflow Cleanup: Replace MVertTri type with C++ vector 2023-12-20 20:59:11 -05:00
renderdoc_dynload RenderDoc: Set Capture Title 2024-02-23 10:57:37 +01:00
rigidbody Cleanup: use const pointers 2024-04-20 12:41:23 +10:00
sky Cleanup: use C-style comments for descriptive text 2024-04-11 17:44:27 +10:00
utfconv CMake: Fix Compiling Shader Builder on macOS 2023-12-08 15:47:14 +01:00
wayland_dynload GHOST/Wayland: expose wl_display_get_protocol_error function 2024-05-03 10:55:17 +10:00
CMakeLists.txt CMake: Fix Compiling Shader Builder on macOS 2023-12-08 15:47:14 +01:00