2D fake lights in cocos creator?


I was wondering if there is any way to implement 2D lights in Cocos Creator that works on both web and native platforms?

I did search the forum but most people either implement a GLSL shader that works only on native platform or Cocos-2D-X or talking about 3D lights in Cocos Creator.

I am not so much a shader guy and I am not looking to implement dynamic lights for now with shadows, but some basic fake lights would do it something like this;

Is there any example or tutorial how something like this could be done by blending sprites maybe?
Or is there any shaders I could borrow that works in both web and native?


There are some exapmles shared in chinese forum, these may be helpful.

1 Like

Masking should be easy to implement but it will be annoying to use.

Lowering the opacity / lowering the visibility of the target sprite, and adding a bright colored(white etc) sprite behind the target sprite will give it a look similar to the gif you posted. But the target sprite will probably lose some saturation. (Not sure about that.)

Not sure if it will work properly though.

1 Like

You can try it.