From bdab538b3019406cfbd53d99bc40c4dbae27393c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 23 May 2022 20:54:09 +0200 Subject: Fix Eevee blackbody wrong with non-default scene linear color space * Port over new code tables from Cycles * Convert Rec.709 to scene linear for lookup table. * Move code for wavelength and blackbody to IMB so they can access the required transforms, which are not in blenlib. * Remove clamping from blackbody shader to bypass the texture read. Since it's variable now easiest to just always read from the texture than pass additional parameters. * Fold XYZ to RGB conversion into the wavelength table. Ref T68926 --- source/blender/draw/intern/draw_fluid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/draw/intern/draw_fluid.c') diff --git a/source/blender/draw/intern/draw_fluid.c b/source/blender/draw/intern/draw_fluid.c index d3d4bbf505e..c34025ebe52 100644 --- a/source/blender/draw/intern/draw_fluid.c +++ b/source/blender/draw/intern/draw_fluid.c @@ -20,6 +20,8 @@ #include "BKE_colorband.h" +#include "IMB_colormanagement.h" + #include "GPU_texture.h" #include "draw_manager.h" @@ -52,7 +54,7 @@ static void create_flame_spectrum_texture(float *data) float *spec_pixels = (float *)MEM_mallocN(TFUNC_WIDTH * 4 * 16 * 16 * sizeof(float), "spec_pixels"); - blackbody_temperature_to_rgb_table(data, TFUNC_WIDTH, 1500, 3000); + IMB_colormanagement_blackbody_temperature_to_rgb_table(data, TFUNC_WIDTH, 1500, 3000); for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { -- cgit v1.2.3