Hello, I'm trying to "gray out" an element of my UI by desaturating it at runtime. I know that I'll need to use shaders for it, however I have never used shaders before.
More specifically, I want to desaturate the icon by say 80% on demand, without having to manually create pre-desaturated sprites.
This is how I currently draw the sprite on the UI:
function draw_skill_icon(skillID, xPos, yPos) {
var spriteIndex = asset_get_index("s_skill_icon_" + skillID);
var xyOffset = 1.1;
var uiScale = global.uiData.scale;
xPos = xyOffset * uiScale + xPos;
yPos = xyOffset * uiScale + yPos;
draw_sprite_ext(spriteIndex, image_index, xPos, yPos, image_xscale*uiScale, image_yscale*uiScale, image_angle, image_blend, image_alpha);
}
The attachment shows how the UI looks in game, it's made up of 3 layers in this order:
- skill slot, (border and background)
- skill icon (drawn using function above)
- slot overlay (drawn over the skill icon)
Any tips on how I could implement this effect using shaders?