简体   繁体   English

对 Canvas 添加后处理

[英]Adding Post-Processing to Canvas

I'm working on a canvas-based heatmap using a library called simpleheat ( https://github.com/mourner/simpleheat ).我正在使用名为 simpleheat ( https://github.com/mourner/simpleheat ) 的库制作基于画布的热图。 I've got the heatmap effect working, but does anyone here know how I'd be able to achieve a glow affect like the image below?我已经得到了热图效果,但是这里有人知道我如何能够实现如下图所示的发光效果吗? I've tried implementing this effect with Pixi filters, but haven't had any luck so far.我试过用 Pixi 过滤器实现这种效果,但到目前为止还没有成功。

在此处输入图像描述

If you do this manually, or point by point based on xy coordinates for a map that you might have, you could just make a canvas overlay for the map and then draw points on the canvas as overlays.如果您手动执行此操作,或者根据您可能拥有的 map 的 xy 坐标逐点执行此操作,则只需为 map 制作一个 canvas 叠加层,然后在 canvas 上绘制点作为叠加层。 I think you can also set the canvas colors as rgba to make them slightly transparent.我想你也可以将 canvas colors 设置为 rgba 使它们稍微透明。

(srry i was gonna make this a comment but i dont have enough reputation for that lol) (对不起,我本来打算对此发表评论,但我没有足够的声誉来笑)

hope this helps希望这可以帮助

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

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