Blender Git Loki

Git Commits -> Revision 7ad802c

Revision 7ad802c by Brecht Van Lommel (master)
May 13, 2019, 13:56 (GMT)
Cycles/Eevee: unified and improved texture image color space handling

Cycles now uses the color space on the image datablock, and uses OpenColorIO
to convert to scene linear as needed. Byte images do not take extra memory,
they are compressed in scene linear + sRGB transfer function which in common
cases is a no-op.

Eevee and workbench were changed to work similar. Float images are stored as
scene linear. Byte images are compressed as scene linear + sRGB and stored in
a GL_SRGB8_ALPHA8 texture. From the GLSL shader side this means they are read
as scene linear, simplifying the code and taking advantage of hardware support.

Further, OpenGL image textures are now all stored with premultiplied alpha.
Eevee texture sampling looks a little different now because interpolation
happens premultiplied and in scene linear space.

Overlays and grease pencil work in sRGB space so those now have an extra
conversion to sRGB after reading from image textures. This is not particularly
elegant but as long as engines use different conventions, one or the other
needs to do conversion.

This change breaks compatibility for cases where multiple image texture nodes
were using the same image with different color space node settings. However it
gives more predictable behavior for baking and texture painting if save, load
and image editing operations have a single color space to handle.

Differential Revision: https://developer.blender.org/D4807

Commit Details:

Full Hash: 7ad802cf3ae500bc72863b6dba0f28a488fce3d1
Parent Commit: e9d2ec4
Lines Changed: +651, -553

42 Modified Paths:

/intern/cycles/blender/blender_shader.cpp (+10, -18) (Diff)
/intern/cycles/render/colorspace.cpp (+20, -12) (Diff)
/intern/opencolorio/ocio_capi.h (+1, -0) (Diff)
/intern/opencolorio/ocio_impl.cc (+1, -1) (Diff)
/source/blender/blenkernel/BKE_blender_version.h (+1, -1) (Diff)
/source/blender/blenloader/intern/versioning_cycles.c (+35, -0) (Diff)
/source/blender/draw/engines/gpencil/gpencil_draw_utils.c (+3, -3) (Diff)
/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl (+23, -2) (Diff)
/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl (+24, -3) (Diff)
/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl (+23, -2) (Diff)
/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl (+8, -22) (Diff)
/source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl (+1, -2) (Diff)
/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl (+1, -2) (Diff)
/source/blender/draw/engines/workbench/workbench_forward.c (+1, -2) (Diff)
/source/blender/draw/engines/workbench/workbench_materials.c (+1, -8) (Diff)
/source/blender/draw/intern/draw_manager_data.c (+1, -2) (Diff)
/source/blender/draw/modes/object_mode.c (+1, -1) (Diff)
/source/blender/draw/modes/paint_texture_mode.c (+3, -3) (Diff)
/source/blender/draw/modes/shaders/object_empty_image_frag.glsl (+22, -1) (Diff)
/source/blender/draw/modes/shaders/paint_texture_frag.glsl (+22, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_image_proj.c (+8, -8) (Diff)
/source/blender/editors/space_node/drawnode.c (+7, -5) (Diff)
/source/blender/gpu/GPU_draw.h (+1, -1) (Diff)
/source/blender/gpu/GPU_material.h (+1, -2) (Diff)
/source/blender/gpu/GPU_texture.h (+1, -4) (Diff)
/source/blender/gpu/intern/gpu_codegen.c (+1, -3) (Diff)
/source/blender/gpu/intern/gpu_codegen.h (+0, -2) (Diff)
/source/blender/gpu/intern/gpu_draw.c (+236, -236) (Diff)
/source/blender/gpu/intern/gpu_material.c (+0, -9) (Diff)
/source/blender/gpu/intern/gpu_texture.c (+1, -1) (Diff)
/source/blender/gpu/shaders/gpu_shader_material.glsl (+15, -32) (Diff)
/source/blender/imbuf/IMB_colormanagement.h (+13, -0) (Diff)
/source/blender/imbuf/intern/colormanagement.c (+91, -0) (Diff)
/source/blender/imbuf/intern/IMB_colormanagement_intern.h (+7, -0) (Diff)
/source/blender/makesdna/DNA_image_types.h (+0, -2) (Diff)
/source/blender/makesdna/DNA_node_types.h (+2, -6) (Diff)
/source/blender/makesrna/intern/rna_color.c (+28, -0) (Diff)
/source/blender/makesrna/intern/rna_image_api.c (+12, -83) (Diff)
/source/blender/makesrna/intern/rna_nodetree.c (+0, -27) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_environment.c (+7, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_image.c (+17, -30) (Diff)
/source/blender/nodes/shader/node_shader_util.h (+1, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021