How do I mask out an image with a selected color?

Godot Version

4.2.1

Question


As shown, I have a light blue lake, and I want to add a deep blue over it with NoiseTexture.
But, the deep blue also covers the white reflection and the lands.
So I’m thinking, “Just tell the shader to only override the pixel when the pixel is exactly #75e3ff !”
Annnd I don’t know how to shader and my time is running out.

Helllp. Thanks for reading.

It would be something like this in the fragment shader.

void fragment () {
  If COLOR == your color {
    COLOR=  your new color;
  }
}

Or something like this

My question is, how do I use the image AS the new color?
All I ever tried was full procedural shader, how do I mix image texture into it?

create sampler2d uniform of noise, then use fastnoiselite to make the noise
then texture it with the current UV so you got the vec4 color of the noise sampler2d
remember to set the noise Seamless option to ON
then multiply noise with your color, or just use its intensity (take the r or g or b value)

if you want see an example, here:

My noise has in-game function, I need to use the return value of “get_noise_2d”, it’s not just for visual effect; also, I’m not planning on blending, I want to replace the pixels.
That said, your answer gave me the direction. Just export the texture instead of trying to read from the node! Silly me.


…New problem. Why isn’t

COLOR = texture(IMAGE_TEXTURE, UV);

doing anything?