提交 e08ad9fa 编写于 作者: J jpark37

UI: Render previews in linear sRGB space

Necessary for correct alpha blending.
上级 71bd5860
......@@ -589,11 +589,13 @@ void OBSBasicFilters::DrawPreview(void *data, uint32_t cx, uint32_t cy)
gs_viewport_push();
gs_projection_push();
const bool previous = gs_set_linear_srgb(true);
gs_ortho(0.0f, float(sourceCX), 0.0f, float(sourceCY), -100.0f, 100.0f);
gs_set_viewport(x, y, newCX, newCY);
obs_source_video_render(window->source);
gs_set_linear_srgb(previous);
gs_projection_pop();
gs_viewport_pop();
}
......
......@@ -148,10 +148,13 @@ void OBSBasicInteraction::DrawPreview(void *data, uint32_t cx, uint32_t cy)
gs_viewport_push();
gs_projection_push();
const bool previous = gs_set_linear_srgb(true);
gs_ortho(0.0f, float(sourceCX), 0.0f, float(sourceCY), -100.0f, 100.0f);
gs_set_viewport(x, y, newCX, newCY);
obs_source_video_render(window->source);
gs_set_linear_srgb(previous);
gs_projection_pop();
gs_viewport_pop();
}
......
......@@ -392,11 +392,13 @@ void OBSBasicProperties::DrawPreview(void *data, uint32_t cx, uint32_t cy)
gs_viewport_push();
gs_projection_push();
const bool previous = gs_set_linear_srgb(true);
gs_ortho(0.0f, float(sourceCX), 0.0f, float(sourceCY), -100.0f, 100.0f);
gs_set_viewport(x, y, newCX, newCY);
obs_source_video_render(window->source);
gs_set_linear_srgb(previous);
gs_projection_pop();
gs_viewport_pop();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册