Some color space issues in sequencer:

Sequencer was always trying to do GLSL color space
conversion, not respecting user settings at all.

This failed a lot when RGB curves a used in color
management settings.

Now sequencer will fallback if GLSL can not be used
and will also respect user settings (however, draw
pixels are not supported, sequencer always uses 2D
textures).
This commit is contained in:
Sergey Sharybin
2013-04-27 15:01:17 +00:00
parent 8069d1ad1a
commit f716eb17e2

View File

@@ -1060,7 +1060,16 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
type = GL_UNSIGNED_BYTE;
}
else {
if (ibuf->rect_float) {
bool force_fallback = false;
force_fallback |= !ELEM(U.image_draw_method, IMAGE_DRAW_METHOD_AUTO, IMAGE_DRAW_METHOD_GLSL);
force_fallback |= ibuf->dither != 0.0f;
if (force_fallback) {
/* Fallback to CPU based color space conversion */
glsl_used = false;
}
else if (ibuf->rect_float) {
display_buffer = ibuf->rect_float;
if (ibuf->channels == 4) {
@@ -1096,6 +1105,15 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
type = GL_UNSIGNED_BYTE;
display_buffer = NULL;
}
/* there's a data to be displayed, but GLSL is not initialized
* properly, in this case we fallback to CPU-based display transform
*/
if ((ibuf->rect || ibuf->rect_float) && !glsl_used) {
display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
format = GL_RGBA;
type = GL_UNSIGNED_BYTE;
}
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);