繁体   English   中英

directx11向DrawLine 2d添加辉光

[英]directx11 add glow to DrawLine 2d

我画一条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);

您可以应用高斯模糊效果 (实际上是在阴影效果中使用),然后(可选) 将“亮度”效果应用于模糊图像,然后最终在原始线条图像的顶部绘制模糊图像。

模糊线

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM