From 68b15fc3ad4f74be192150d3a2fb35e7ef2d4edd Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Thu, 2 May 2019 15:45:31 +0200 Subject: Cycles: support loading images from arbitrary OpenColorIO color space These are the internal changes to Cycles, for Blender integration there are no functional changes in this commit. Images are converted to scene linear color space on file load, and on reading from the OpenImageIO texture cache. 8-bit images are compressed with the sRGB transfer function to avoid precision loss while keeping memory usages low. This also means that for common cases of 8-bit sRGB images no conversion happens at all on image loading. Initial patch by Lukas, completed by Brecht. Differential Revision: https://developer.blender.org/D3491 --- intern/cycles/render/shader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'intern/cycles/render/shader.cpp') diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index ac3303cbfeb..ec85e516832 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -14,9 +14,11 @@ * limitations under the License. */ +#include "device/device.h" + #include "render/background.h" #include "render/camera.h" -#include "device/device.h" +#include "render/colorspace.h" #include "render/graph.h" #include "render/integrator.h" #include "render/light.h" @@ -717,6 +719,8 @@ void ShaderManager::free_memory() #ifdef WITH_OSL OSLShaderManager::free_memory(); #endif + + ColorSpaceManager::free_memory(); } float ShaderManager::linear_rgb_to_gray(float3 c) -- cgit v1.2.3