How to code a shader which illuminates pixels if the player is in proximity?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Axiot

The basic idea is that a part of a sprite changes color when the player is close. Therefore i thought get the distance of the player and the fragment( pixel ) and check if it is lower than a specific threshold. To only change a part of the sprite check if the color of the pixel is equal and then change it to the illuminated color. I struggeled to implement this idea since i am farily new to shader programming. Can someone please help me? My goal is to recreated this cool effect which i recently saw on pinterest.


I am also interested in this question

Themarly | 2021-06-04 23:12

:bust_in_silhouette: Reply From: exuin