0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

obs-transitions: Linear SRGB, swipe

This commit is contained in:
jpark37 2021-01-21 06:00:23 -08:00
parent 33ace6b817
commit 14d9b57422

View File

@ -88,12 +88,26 @@ 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);
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 linear_srgb = gs_get_linear_srgb();
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);
while (gs_effect_loop(swipe->effect, "Swipe"))
gs_draw_sprite(NULL, 0, cx, cy);
gs_enable_framebuffer_srgb(previous);
}
static void swipe_video_render(void *data, gs_effect_t *effect)