obs-transitions: Nonlinear SRGB, swipe

Switch back for now. Maybe we want CIELUV, but that's expensive.
This commit is contained in:
jpark37 2021-04-21 20:36:45 -07:00
parent 8c826f5bc3
commit a5cef2513b

View File

@ -88,26 +88,12 @@ static void swipe_callback(void *data, gs_texture_t *a, gs_texture_t *b,
vec2_mulf(&swipe_val, &swipe_val, swipe->swipe_in ? 1.0f - t : t); vec2_mulf(&swipe_val, &swipe_val, swipe->swipe_in ? 1.0f - t : t);
const bool linear_srgb = gs_get_linear_srgb(); gs_effect_set_texture(swipe->a_param, swipe->swipe_in ? b : a);
gs_effect_set_texture(swipe->b_param, swipe->swipe_in ? a : b);
const bool previous = gs_framebuffer_srgb_enabled();
gs_enable_framebuffer_srgb(linear_srgb);
gs_texture_t *t0 = swipe->swipe_in ? b : a;
gs_texture_t *t1 = swipe->swipe_in ? a : b;
if (linear_srgb) {
gs_effect_set_texture_srgb(swipe->a_param, t0);
gs_effect_set_texture_srgb(swipe->b_param, t1);
} else {
gs_effect_set_texture(swipe->a_param, t0);
gs_effect_set_texture(swipe->b_param, t1);
}
gs_effect_set_vec2(swipe->swipe_param, &swipe_val); gs_effect_set_vec2(swipe->swipe_param, &swipe_val);
while (gs_effect_loop(swipe->effect, "Swipe")) while (gs_effect_loop(swipe->effect, "Swipe"))
gs_draw_sprite(NULL, 0, cx, cy); gs_draw_sprite(NULL, 0, cx, cy);
gs_enable_framebuffer_srgb(previous);
} }
static void swipe_video_render(void *data, gs_effect_t *effect) static void swipe_video_render(void *data, gs_effect_t *effect)