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.)
This commit is contained in:
jp9000 2021-05-11 00:34:50 -07:00
parent d4780e061c
commit c4e0a68641

View File

@ -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);