1
0
Эх сурвалжийг харах

libobs: Use alpha when rendering scenes

This is just in case a filter is applied to a scene, filters will turn
off the blending so it's necessary to set the blending.
jp9000 10 жил өмнө
parent
commit
4abae186ce
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      libobs/obs-scene.c

+ 5 - 0
libobs/obs-scene.c

@@ -306,6 +306,9 @@ static void scene_video_render(void *data, gs_effect_t *effect)
 
 	item = scene->first_item;
 
+	gs_blend_state_push();
+	gs_blend_function(GS_BLEND_SRCALPHA, GS_BLEND_INVSRCALPHA);
+
 	while (item) {
 		if (obs_source_removed(item->source)) {
 			struct obs_scene_item *del_item = item;
@@ -326,6 +329,8 @@ static void scene_video_render(void *data, gs_effect_t *effect)
 		item = item->next;
 	}
 
+	gs_blend_state_pop();
+
 	pthread_mutex_unlock(&scene->mutex);
 
 	UNUSED_PARAMETER(effect);