0
即时绘制一个2d线如何添加辉光效果?directx11添加辉光绘制2d
auto renderer::draw_line(point<float> const& start_point, point<float> const& end_point, float const stroke_width, color const& stroke_color) -> void {
brush->SetColor(D2D1::ColorF(stroke_color.r, stroke_color.g, stroke_color.b, stroke_color.a));
device_context_d2d1->DrawLine(
D2D1::Point2F(start_point.x + offsetX, start_point.y + offsetY),
D2D1::Point2F(end_point.x + offsetX, end_point.y + offsetY),
brush.get(), stroke_width
);
}
我觉得它有什么待办事项使用此功能
ID2D1Effect* shadowEffect;
device_context_d2d1->CreateEffect(CLSID_D2D1Shadow, &shadowEffect);
不是100%确定你的意思。不会只是模糊我的路线,没有更多? – vusuzireru
是的,但这就是所有这些发光效果的典型工作方式,拍摄图像的“发光”部分(在这种情况下为线条),将其模糊并在原始图像的顶部绘制(可能调整后的亮度)。如果将模糊的图像颜色变成黑色,并在其上绘制原始图像,则会产生阴影效果。 – VTT
感谢您的信息,即时通讯有点困惑如何应用模糊线,因为'SetInput'需要一个图像?我怎么会只模糊一边是否有某种地区的函数在directx11? – vusuzireru