Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2022-04-15 10:24:28 +0300
committerJeroen Bakker <jeroen@blender.org>2022-04-15 10:24:28 +0300
commit1f8e9ad6de29021bf1a84d7133f665bd5bec8157 (patch)
treee3b3cf1cb2bb93d2e3f80231b338fbcc40c5066e
parent5ba160ce96c68ddbfde1d34c7993a8e2f9db4935 (diff)
Color management of brush colors
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_paint_image.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
index 2ad4fc9172e..da8758b1f20 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
@@ -198,10 +198,15 @@ template<typename ImageBuffer> class PaintingKernel {
copy_v3_v3(brush_color,
ss->cache->invert ? BKE_brush_secondary_color_get(ss->scene, brush) :
BKE_brush_color_get(ss->scene, brush));
+ /* NOTE: Brush colors are stored in sRGB. We use math color to follow other areas that
+ * use brush colors. From there on we use IMB_colormanagement to convert the brush color to the
+ * colorspace of the texture. This isn't ideal, but would need more refactoring to make sure
+ * that brush colors are stored in scene linear by default. */
+ srgb_to_linearrgb_v3_v3(brush_color, brush_color);
brush_color[3] = 1.0f;
const char *from_colorspace = IMB_colormanagement_role_colorspace_name_get(
- COLOR_ROLE_COLOR_PICKING);
+ COLOR_ROLE_SCENE_LINEAR);
ColormanageProcessor *cm_processor = IMB_colormanagement_colorspace_processor_new(
from_colorspace, to_colorspace);
IMB_colormanagement_processor_apply_v4(cm_processor, brush_color);