Godot 4, 3D, How to make a screen shader that interacts with 3d light?

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

Guys and Gals, I am wondering how to achieve some form of interaction between a screen shader and 3d lights.

In my FPS project I added a simple canvas shader that shows a texture with some lens dirt. This alone looks quite OK, but in order to make it look real I’d like the texture to respond to 3d light in the scene (ie, become highlighted when the cam is pointed at a light source in the 3d scene). I like to think it’s possible with a shader (eg, there is a lens flare shader that interacts with 3d light).

I’ll appreciate any tips. Thanks.