I downloaded the project and I think I found what might be causing the shader not to work.
The problem seems to be on the following line:
float maskValue = texture(mask, UV).r;
As far as I can tell, the reason this is causing an issue with custom drawn Godot node is because the the UV
property either isn't properly set, or all four of the UV points for the quad drawing the circle are set to the same point. (This seems more likely).
The only reason I think this is the case is because when you change the code to the snippet below, the rest of the code works as expected, albeit not like the shader is intended:
float maskValue = texture(mask, SCREEN_UV).r;
This is almost certainly a bug with the draw_circle
function. If you replace draw_circle
with draw_rect
, it works as expected, though interestingly it goes opposite the direction of the sprite
node.