Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1066)

Issue 7018048: Alpha premul pipeline cleanup (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by sergey.vfx
Modified:
11 years, 3 months ago
Reviewers:
xavier.thomas.1980, brechtvl, bf-codereview
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

Alpha premul pipeline cleanup This assumptions are now made: - Internally float buffers are always linear alpha-premul colors - Readers should worry about delivering float buffers with that assumptions. - There's an input image setting to say whether it's stored with straight/premul alpha on the disk. - Byte buffers are now assumed have straight alpha, readers should deliver straight alpha. Some implementation details: - Removed scene's color unpremultiply setting, which was very much confusing and was wrong for default settings. Now all renderers assumes to deliver premultiplied alpha. - IMB_buffer_byte_from_float will now linearize alpha when converting from buffer. - Sequencer's effects were changed to assume bytes have got straight alpha. Most of effects will work with bytes still, however for glow it was more tricky to avoid data loss, so there's a commented out glow implementation which converts byte buffer to floats first, operates on floats and returns bytes back. It's slower and not sure if it should actually be used -- who're using glow on alpha anyway? - Sequencer modifiers should also be working nice with straight bytes now. - GLSL preview will predivide float textures to make nice shading, shading with byte textures worked nice (GLSL was assuming straight alpha). - Blender Internal will set alpha=1 to the whole sky. The same happens in Cycles and there's no way to avoid this -- sky is neither straight nor premul and doesn't fit color pipeline well. - Straight alpha mode for render result was also eliminated.

Patch Set 1 #

Total comments: 6

Patch Set 2 : Corrections to most of comments #

Patch Set 3 : Updated patch, detailed comments later #

Patch Set 4 : Updates for Use Alpha texture settings. Basically replaces by per-image datablock use Alpha. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+783 lines, -487 lines) Patch
intern/cycles/blender/addon/properties.py View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
release/scripts/startup/bl_ui/properties_scene.py View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
release/scripts/startup/bl_ui/properties_texture.py View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
release/scripts/startup/bl_ui/space_sequencer.py View 1 2 3 2 chunks +1 line, -1 line 0 comments Download
source/blender/blenkernel/intern/image.c View 1 2 3 9 chunks +39 lines, -20 lines 0 comments Download
source/blender/blenkernel/intern/seqeffects.c View 1 2 3 24 chunks +210 lines, -160 lines 0 comments Download
source/blender/blenkernel/intern/seqmodifier.c View 1 2 3 1 chunk +12 lines, -8 lines 0 comments Download
source/blender/blenkernel/intern/sequencer.c View 1 2 3 12 chunks +62 lines, -65 lines 0 comments Download
source/blender/blenkernel/intern/texture.c View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
source/blender/blenlib/BLI_math_color.h View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
source/blender/blenlib/intern/math_color_inline.c View 1 2 3 2 chunks +58 lines, -25 lines 0 comments Download
source/blender/blenloader/intern/readfile.c View 1 2 3 1 chunk +27 lines, -1 line 0 comments Download
source/blender/blenloader/intern/versioning_legacy.c View 1 2 3 3 chunks +4 lines, -6 lines 0 comments Download
source/blender/collada/DocumentImporter.cpp View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download
source/blender/editors/render/render_preview.c View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
source/blender/editors/space_image/image_buttons.c View 1 2 3 2 chunks +18 lines, -4 lines 0 comments Download
source/blender/gpu/intern/gpu_draw.c View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
source/blender/gpu/intern/gpu_material.c View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
source/blender/imbuf/IMB_colormanagement.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
source/blender/imbuf/IMB_imbuf.h View 1 2 3 3 chunks +3 lines, -1 line 0 comments Download
source/blender/imbuf/IMB_imbuf_types.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
source/blender/imbuf/intern/IMB_filter.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
source/blender/imbuf/intern/cineon/cineon_dpx.c View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
source/blender/imbuf/intern/colormanagement.c View 1 2 3 22 chunks +34 lines, -29 lines 0 comments Download
source/blender/imbuf/intern/divers.c View 1 2 3 13 chunks +54 lines, -27 lines 0 comments Download
source/blender/imbuf/intern/filter.c View 1 2 3 1 chunk +64 lines, -0 lines 0 comments Download
source/blender/imbuf/intern/openexr/openexr_api.cpp View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
source/blender/imbuf/intern/radiance_hdr.c View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
source/blender/imbuf/intern/readimage.c View 1 2 3 2 chunks +18 lines, -6 lines 0 comments Download
source/blender/imbuf/intern/scaling.c View 1 2 3 2 chunks +23 lines, -12 lines 0 comments Download
source/blender/imbuf/intern/tiff.c View 1 2 3 9 chunks +38 lines, -14 lines 0 comments Download
source/blender/makesdna/DNA_image_types.h View 1 2 3 3 chunks +12 lines, -2 lines 0 comments Download
source/blender/makesdna/DNA_scene_types.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
source/blender/makesdna/DNA_sequence_types.h View 1 2 3 3 chunks +11 lines, -2 lines 0 comments Download
source/blender/makesdna/DNA_texture_types.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
source/blender/makesrna/intern/rna_image.c View 1 2 3 4 chunks +24 lines, -11 lines 0 comments Download
source/blender/makesrna/intern/rna_scene.c View 1 2 3 2 chunks +1 line, -9 lines 0 comments Download
source/blender/makesrna/intern/rna_sequencer.c View 1 2 3 1 chunk +9 lines, -3 lines 0 comments Download
source/blender/makesrna/intern/rna_texture.c View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
source/blender/nodes/composite/node_composite_util.c View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
source/blender/nodes/composite/nodes/node_composite_image.c View 1 2 3 2 chunks +1 line, -2 lines 0 comments Download
source/blender/render/intern/include/render_result.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
source/blender/render/intern/source/imagetexture.c View 1 2 3 5 chunks +15 lines, -15 lines 0 comments Download
source/blender/render/intern/source/pipeline.c View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
source/blender/render/intern/source/render_result.c View 1 2 3 3 chunks +4 lines, -7 lines 0 comments Download
source/blender/render/intern/source/rendercore.c View 1 2 3 4 chunks +2 lines, -31 lines 0 comments Download

Messages

Total messages: 22
sergey.vfx
11 years, 4 months ago (2012-12-28 11:07:19 UTC) #1
brechtvl
https://codereview.appspot.com/7018048/diff/1/intern/opencolorio/fallback_impl.cc File intern/opencolorio/fallback_impl.cc (right): https://codereview.appspot.com/7018048/diff/1/intern/opencolorio/fallback_impl.cc#newcode266 intern/opencolorio/fallback_impl.cc:266: inv_alpha = alpha != 0.0f ? 1.0f / alpha ...
11 years, 4 months ago (2012-12-28 13:04:26 UTC) #2
brechtvl
With the extra premultiplication in ibuf_get_color texture filtering works mostly correct, however mipmapping (IMB_makemipmap) is ...
11 years, 4 months ago (2012-12-28 13:31:00 UTC) #3
brechtvl
https://codereview.appspot.com/7018048/diff/1/source/blender/render/intern/source/imagetexture.c File source/blender/render/intern/source/imagetexture.c (right): https://codereview.appspot.com/7018048/diff/1/source/blender/render/intern/source/imagetexture.c#newcode106 source/blender/render/intern/source/imagetexture.c:106: /* bytes are internally straight, however render pipeline seems ...
11 years, 4 months ago (2012-12-28 14:22:34 UTC) #4
brechtvl
* Are we handling 16 bit PNG images correctly, are they convert from straight to ...
11 years, 4 months ago (2012-12-28 14:25:43 UTC) #5
sergey.vfx
Corrections to most of comments
11 years, 4 months ago (2012-12-29 20:30:27 UTC) #6
sergey.vfx
On 2012/12/28 13:04:26, brechtvl wrote: > https://codereview.appspot.com/7018048/diff/1/intern/opencolorio/fallback_impl.cc > File intern/opencolorio/fallback_impl.cc (right): > > https://codereview.appspot.com/7018048/diff/1/intern/opencolorio/fallback_impl.cc#newcode266 > ...
11 years, 4 months ago (2012-12-29 20:31:42 UTC) #7
sergey.vfx
On 2012/12/28 13:31:00, brechtvl wrote: > With the extra premultiplication in ibuf_get_color texture filtering works ...
11 years, 4 months ago (2012-12-29 20:33:47 UTC) #8
sergey.vfx
On 2012/12/28 14:22:34, brechtvl wrote: > https://codereview.appspot.com/7018048/diff/1/source/blender/render/intern/source/imagetexture.c > File source/blender/render/intern/source/imagetexture.c (right): > > https://codereview.appspot.com/7018048/diff/1/source/blender/render/intern/source/imagetexture.c#newcode106 > ...
11 years, 4 months ago (2012-12-29 20:34:01 UTC) #9
sergey.vfx
On 2012/12/28 14:25:43, brechtvl wrote: > * Are we handling 16 bit PNG images correctly, ...
11 years, 4 months ago (2012-12-29 20:45:57 UTC) #10
xavier.thomas.1980_gmail.com
> However, byte buffers behaves quite fuzzy. When i do a stroke with white > ...
11 years, 4 months ago (2012-12-29 22:41:44 UTC) #11
sergey.vfx
On 2012/12/29 22:41:44, xavier.thomas.1980_gmail.com wrote: > > However, byte buffers behaves quite fuzzy. When i ...
11 years, 4 months ago (2012-12-29 23:06:16 UTC) #12
xavier.thomas.1980_gmail.com
The double can come from the painting too. If you paint on an fully transparant ...
11 years, 4 months ago (2012-12-29 23:06:56 UTC) #13
xavier.thomas.1980_gmail.com
I am patching now, but I cannot promess I will have time to debug :( ...
11 years, 4 months ago (2012-12-29 23:11:39 UTC) #14
xavier.thomas.1980_gmail.com
Hi, I made some tests and read most of the painting code but did not ...
11 years, 3 months ago (2012-12-30 03:24:07 UTC) #15
brechtvl
On 2012/12/29 20:33:47, sergey.vfx wrote: > On 2012/12/28 13:31:00, brechtvl wrote: > > With the ...
11 years, 3 months ago (2012-12-30 10:20:44 UTC) #16
brechtvl
On 2012/12/29 20:45:57, sergey.vfx wrote: > > * For TIFF we should also read/write the ...
11 years, 3 months ago (2012-12-30 10:32:10 UTC) #17
sergey.vfx
> I think Gimp might not be reading the metadata then, since it seems we ...
11 years, 3 months ago (2012-12-30 10:50:26 UTC) #18
sergey.vfx
Updated patch, detailed comments later
11 years, 3 months ago (2012-12-30 15:55:46 UTC) #19
sergey.vfx
In updated patch there is: - Alpha mode is set properly to TIFF files. There's ...
11 years, 3 months ago (2012-12-30 15:57:51 UTC) #20
sergey.vfx
Updates for Use Alpha texture settings. Basically replaces by per-image datablock use Alpha.
11 years, 3 months ago (2012-12-31 13:08:31 UTC) #21
sergey.vfx
11 years, 3 months ago (2012-12-31 13:54:08 UTC) #22
Commited to svn.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b