Transparency for emojis
This commit is contained in:
		
					parent
					
						
							
								487b7bbe3c
							
						
					
				
			
			
				commit
				
					
						2ff4bfbbf3
					
				
			
		
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -116,7 +116,9 @@ fn vs_main(in_vert: VertexInput) -> VertexOutput {
 | 
				
			||||||
fn fs_main(in_frag: VertexOutput) -> @location(0) vec4<f32> {
 | 
					fn fs_main(in_frag: VertexOutput) -> @location(0) vec4<f32> {
 | 
				
			||||||
    switch in_frag.content_type {
 | 
					    switch in_frag.content_type {
 | 
				
			||||||
        case 0u: {
 | 
					        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: {
 | 
					        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);
 | 
					            return vec4<f32>(in_frag.color.rgb, in_frag.color.a * textureSampleLevel(mask_atlas_texture, atlas_sampler, in_frag.uv, 0.0).x);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue