From c4e0a686411495f508fb81f0bc228b81976e6a1e Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 11 May 2021 00:34:50 -0700 Subject: [PATCH] obs-transitions: Fix track matte rendering improper sizes When using track matte stingers as visibility transitions, it would render the matte portion at the incorrect size. This was due to the fact that texrender render code blocks do not set the projection matrix. You're supposed to do that manually. Thus, it was using whatever the current projection matrix was, which was usually the canvas projection matrix. (Jim note: There were reasons why I didn't make texrender objects do this automatically, mostly scaling and performance reasons, but I realize now I should have at least provided an option for it instead to prevent this "gotcha" situation from happening. Bad design on my part. I do not blame Palakis for falling for this.) --- plugins/obs-transitions/transition-stinger.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/obs-transitions/transition-stinger.c b/plugins/obs-transitions/transition-stinger.c index 6af7a5827..22d469675 100644 --- a/plugins/obs-transitions/transition-stinger.c +++ b/plugins/obs-transitions/transition-stinger.c @@ -237,6 +237,9 @@ static void stinger_matte_render(void *data, gs_texture_t *a, gs_texture_t *b, gs_matrix_translate3f(width_offset, height_offset, 0.0f); gs_clear(GS_CLEAR_COLOR, &background, 0.0f, 0); + gs_ortho(0.0f, (float)cx, 0.0f, (float)cy, -100.0f, + 100.0f); + obs_source_video_render(matte_source); gs_texrender_end(s->matte_tex);