Hi everyone,
I've been messing around with shaders a tiny bit, and decided to make a shader where all of the black pixels in my game turn white, if a boolean is set to true. (I plan on using an animation player to toggle the param between false and true a few times. to give it that lightning feel.)
This is what I got, and actually works nicely!
BUT, it only works for the sprite that I attach this shader script to.
I was hoping to make a screen sized sprite that contains this shader, and everything behind it would react to it.

Here for an example, I added a skull to the sprite texture, and made the rect_size huge, hoping that everything within the rect_size will also react. This sprite contains the script. The boolean is currently false. When i set it to true:

So i was hoping that the things within the rect_size of the sprite would also have the same behavior. Here is what I have.
shader_type canvas_item;
uniform bool lightning = false;
void fragment() {
vec4 curr_color = texture(TEXTURE,UV); // Get current color of pixel
if (lightning && curr_color == vec4(0,0,0,1)){
COLOR = vec4(1, 1, 1, 1);
}else{
COLOR = curr_color;
}
}
I understand that this is happening because of my script, i just dont know how to expand it to things that are underneath the rect_size of the sprite containing the shader.
Any help would be greatly appreciated!