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
This commit is contained in:
Lukas Stockner
2019-05-02 15:45:31 +02:00
committed by Brecht Van Lommel
parent dba4684f82
commit 68b15fc3ad
13 changed files with 291 additions and 146 deletions

View File

@@ -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)