iOS / GLES2: How to achieve Glow Effect

╄→гoц情女王★ 提交于 2019-12-02 06:58:22
Steven Veltema

If you use drawRect for your drawing your needle you could possible do something like this:

Is there an easy way or library available to let text glow?

You could create the glow around the needle's image in Photoshop. Just replace the image in the app at runtime when glow is turned on.

I experimented with a lot of approaches here.

basically I neeed two images; one glowing and one not.

then I can draw them as CALayers on top of one another, and hijack CADisplayLink, setting

glowLayer.opacity = glowFac;
dullLayer.opacity = (1 - glowFac);

I also played with fiddling around in GL shaders, passing the glow factor as a uniform, but this is a ton of code to do basically the same thing.

NB I needed to find a graphic artist to 'glow' the image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!