0 votes

Hi All, pretty new to shaders but I want to remove a particular color from some icons. In the editor the code works and I have this:

editor view
editor view

but when I run the game the shader doesn't seem to work:

game view
game view

I've used the color picker tool to select the right color which is 0x075f00, I've checked in gimp and it's the same value. Is godot doing something to change the pixel values in game?

shader_type canvas_item;
uniform vec4 alpha_mask: hint_color;

void fragment(){
  COLOR = texture(TEXTURE, UV); //read from texture
  if(vec3(COLOR.r, COLOR.g, COLOR.b) == vec3(alpha_mask.r, alpha_mask.g, alpha_mask.b))
    {
        COLOR.a = 0.0;
    }
}
Godot version v3.3.1
in Engine by (102 points)

Which operating system are you using?

Also, can you reproduce this issue after disabling batching in the Project Settings then restarting the editor?

Ubuntu 20.04 and yes disabling batching same issue, editor is fine but the game/scene is not

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.