From 2ff4bfbbf3d4a91bd94a799a100b7fac20733530 Mon Sep 17 00:00:00 2001 From: Isaac Mills Date: Wed, 16 Oct 2024 10:50:13 -0600 Subject: [PATCH] Transparency for emojis --- src/shader.wgsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shader.wgsl b/src/shader.wgsl index 1813a66..e99dc3e 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -116,7 +116,9 @@ fn vs_main(in_vert: VertexInput) -> VertexOutput { fn fs_main(in_frag: VertexOutput) -> @location(0) vec4 { 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(in_frag.color.rgb, in_frag.color.a * textureSampleLevel(mask_atlas_texture, atlas_sampler, in_frag.uv, 0.0).x);