Transparency for emojis

This commit is contained in:
Isaac Mills 2024-10-16 10:50:13 -06:00
parent 487b7bbe3c
commit 2ff4bfbbf3
Signed by: fnmain
GPG key ID: B67D7410F33A0F61

View file

@ -116,7 +116,9 @@ fn vs_main(in_vert: VertexInput) -> VertexOutput {
fn fs_main(in_frag: VertexOutput) -> @location(0) vec4<f32> {
switch in_frag.content_type {
case 0u: {
return textureSampleLevel(color_atlas_texture, atlas_sampler, in_frag.uv, 0.0);
var sample = textureSampleLevel(color_atlas_texture, atlas_sampler, in_frag.uv, 0.0);
sample[3] = sample[3] * in_frag.color.a;
return sample;
}
case 1u: {
return vec4<f32>(in_frag.color.rgb, in_frag.color.a * textureSampleLevel(mask_atlas_texture, atlas_sampler, in_frag.uv, 0.0).x);