From c0cc81d20fd0a02b8f65a5e22931d7447275acee Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 14 Mar 2015 00:32:45 -0700 Subject: [PATCH] libobs: Turn blending off for filter renders When rendering a filter to a texture, the target is empty and unused, so there's no reason for blending to be on when rendering the filter to a render target. --- libobs/obs-source.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 60e621b99..f535a23f9 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -2058,6 +2058,9 @@ void obs_source_process_filter_begin(obs_source_t *filter, filter->filter_texrender = gs_texrender_create(format, GS_ZS_NONE); + gs_blend_state_push(); + gs_blend_function(GS_BLEND_ONE, GS_BLEND_ZERO); + if (gs_texrender_begin(filter->filter_texrender, cx, cy)) { bool custom_draw = (parent_flags & OBS_SOURCE_CUSTOM_DRAW) != 0; bool async = (parent_flags & OBS_SOURCE_ASYNC) != 0; @@ -2074,6 +2077,8 @@ void obs_source_process_filter_begin(obs_source_t *filter, gs_texrender_end(filter->filter_texrender); } + + gs_blend_state_pop(); } void obs_source_process_filter_end(obs_source_t *filter, gs_effect_t *effect,