Quellcode durchsuchen

libobs: Reset projection transform when cropping

The crop texture would not always render correctly because the
projection matrix had not been set.
jp9000 vor 9 Jahren
Ursprung
Commit
acd8b612ee
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 7 0
      libobs/obs-scene.c

+ 7 - 0
libobs/obs-scene.c

@@ -394,6 +394,13 @@ static inline void render_item(struct obs_scene_item *item)
 		if (cx && cy && gs_texrender_begin(item->crop_render, cx, cy)) {
 			float cx_scale = (float)width  / (float)cx;
 			float cy_scale = (float)height / (float)cy;
+			struct vec4 clear_color;
+
+			vec4_zero(&clear_color);
+			gs_clear(GS_CLEAR_COLOR, &clear_color, 0.0f, 0);
+			gs_ortho(0.0f, (float)width, 0.0f, (float)height,
+					-100.0f, 100.0f);
+
 			gs_matrix_scale3f(cx_scale, cy_scale, 1.0f);
 			gs_matrix_translate3f(
 					-(float)item->crop.left,