How do I make a shader that changes white pixels to green?
Posted: Sat Nov 19, 2022 12:02 am
I've already got shaders working. This example shader is definitely doing something to make my game look wrong:
I've not been able to find out how to make a shader that just goes:
How could I do this?
Code: Select all
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords )
{
vec4 c = Texel(texture, texture_coords); // This reads a color from our texture at the coordinates LOVE gave us (0-1, 0-1)
return vec4(vec3(1.0, 1.0, 1.0) * (max(c.r, max(c.g, c.b))), 0.2); // This just returns a white color that's modulated by the brightest color channel at the given pixel in the texture. Nothing too complex, and not exactly the prettiest way to do B&W :P
}
Code: Select all
if pixel = white then make pixel green