Make capture sources w/o alpha use opaque effect
This fixes an issue primarily with filter rendering: when capturing windows and displays, their alpha channel is almost always 0, causing the image to be completely invisible unintentionally. The original fix for this for many sources was just to turn off the blending, which would be fine if you're not rendering any filters, but filters will render to render targets first, and that lack of alpha will end up carrying over in to the final image. This doesn't apply to any mac captures because mac actually seems to set the alpha channel to 1.
This commit is contained in:
@@ -201,10 +201,17 @@ void cursor_draw(struct cursor_data *data, long x_offset, long y_offset,
|
||||
return;
|
||||
|
||||
if (data->visible && !!data->texture) {
|
||||
gs_blend_state_push();
|
||||
gs_blend_function(GS_BLEND_SRCALPHA, GS_BLEND_INVSRCALPHA);
|
||||
gs_enable_color(true, true, true, false);
|
||||
|
||||
gs_matrix_push();
|
||||
gs_matrix_scale3f(x_scale, y_scale, 1.0f);
|
||||
obs_source_draw(data->texture, x_draw, y_draw, 0, 0, false);
|
||||
gs_matrix_pop();
|
||||
|
||||
gs_enable_color(true, true, true, true);
|
||||
gs_blend_state_pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user