Skip to content

Commit

Permalink
obs-transitions: Fix track matte rendering improper sizes
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
jp9000 committed May 11, 2021
1 parent d4780e0 commit c4e0a68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/obs-transitions/transition-stinger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c4e0a68

Please sign in to comment.