diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-12-31 17:52:13 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-12-31 17:52:13 +0400 |
commit | 08cea96ab08026ae9a3351b3e5830eda93f3106f (patch) | |
tree | 5fdcc1f2dc6ccf6388ba8bbe5792c18ddeddb424 /source/blender/makesdna/DNA_sequence_types.h | |
parent | 97c6a55c39e1a1949e04cf491946f8b275e2efb5 (diff) |
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.
- Conversion to correct alpha need to be done before linearizing
float buffer.
- TIFF will now load and save files with proper alpha mode setting
in file meta data header.
- Remove Use Alpha from texture mapping and replaced with image
datablock setting.
Behaves much more predictable and clear from code point of view
and solves possible regressions when non-premultiplied images were
used as textures with ignoring alpha channel.
Diffstat (limited to 'source/blender/makesdna/DNA_sequence_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index f106c8f918a..0aa466f7245 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -172,7 +172,10 @@ typedef struct Sequence { float blend_opacity; /* is sfra needed anymore? - it looks like its only used in one place */ - int sfra, pad; /* starting frame according to the timeline of the scene. */ + int sfra; /* starting frame according to the timeline of the scene. */ + + char alpha_mode; + char pad[3]; /* modifiers */ ListBase modifiers; @@ -315,7 +318,7 @@ typedef struct SequencerScopes { #define SEQ_OVERLAP (1 << 3) #define SEQ_FILTERY (1 << 4) #define SEQ_MUTE (1 << 5) -#define SEQ_MAKE_PREMUL (1 << 6) +#define SEQ_MAKE_PREMUL (1 << 6) /* deprecated, used for compatibility code only */ #define SEQ_REVERSE_FRAMES (1 << 7) #define SEQ_IPO_FRAME_LOCKED (1 << 8) #define SEQ_EFFECT_NOT_LOADED (1 << 9) @@ -366,6 +369,12 @@ typedef struct SequencerScopes { #define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS 8 #define SEQ_PROXY_TC_ALL 15 +/* seq->alpha_mode */ +enum { + SEQ_ALPHA_STRAIGHT = 0, + SEQ_ALPHA_PREMUL = 1 +}; + /* seq->type WATCH IT: SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!!! */ enum { SEQ_TYPE_IMAGE = 0, |