#include using namespace metal; struct _fs_main_Input { float2 uv [[user(locn0)]]; }; struct _fs_main_Output { float4 _value [[user(locn0)]]; }; fragment _fs_main_Output fs_main(_fs_main_Input input [[stage_in]], texture2d albedo_tex_tex [[texture(0)]], sampler albedo_tex_samp [[sampler(0)]]) { _fs_main_Output __luma_output; float4 color = albedo_tex_tex.sample(albedo_tex_samp, input.uv); float dx = dfdx(color.r); float dy = dfdy(color.r); float fw = fwidth(color.r); float edge = step(0.1, fw); __luma_output._value = float4((color.rgb * (1.0 - edge)), color.a); return __luma_output; }