Andymakeer
Member
Hi guys!
I'm using a shader to recolor my sprites but its not turning out the way i want.
This is what happening:
I have "bullet" sprites that i want them to change their color if they are "frozen".
These are them at normal state:
These is what I want them to become:
I got this using the Colorize tool from the sprite editor
Now the coding:
This is my shader:
and this is my code on draw event:
Those numbers on uniform are the RGB color divided by 255 (parsing to shader color).
But ingame the result is this:
The black borders around the bullets are being recolored too, which is NOT what I want.
Basically, I want THE SAME EFFECT that happens when you use the Colorize tool from the sprite editor.
Help me please ;-;
I'm using a shader to recolor my sprites but its not turning out the way i want.
This is what happening:
I have "bullet" sprites that i want them to change their color if they are "frozen".
These are them at normal state:
These is what I want them to become:
I got this using the Colorize tool from the sprite editor
Now the coding:
This is my shader:
Code:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec3 u_color;
void main()
{
vec4 texColor = texture2D(gm_BaseTexture, v_vTexcoord);
gl_FragColor = v_vColour * vec4(u_color.rgb, texColor.a);
}
Code:
if freeze_amp < 1
{
shader_set(shader_Recolor);
shader_set_uniform_f(_uniColor, 66 / 255, 236 / 255, 225 / 255);
}
draw_self();
shader_reset();
But ingame the result is this:
The black borders around the bullets are being recolored too, which is NOT what I want.
Basically, I want THE SAME EFFECT that happens when you use the Colorize tool from the sprite editor.
Help me please ;-;