From a05364702e2ad38275efb0d88ab4978a84c28016 Mon Sep 17 00:00:00 2001 From: cybersoulK Date: Tue, 24 Dec 2024 15:41:54 -0800 Subject: [PATCH 1/5] try fix --- crates/yakui-wgpu/shaders/main.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/yakui-wgpu/shaders/main.wgsl b/crates/yakui-wgpu/shaders/main.wgsl index 9d932a6c..4e728401 100644 --- a/crates/yakui-wgpu/shaders/main.wgsl +++ b/crates/yakui-wgpu/shaders/main.wgsl @@ -35,7 +35,7 @@ fn vs_main( @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { var color = textureSample(color_texture, color_sampler, in.texcoord); - color *= in.color.a; + color *= vec4(vec3(in.color.a), 1.0); return in.color * color; } \ No newline at end of file From 2dbbded09cb34cb2023c116b1bd789b9eca0318f Mon Sep 17 00:00:00 2001 From: cybersoulK Date: Tue, 24 Dec 2024 15:52:24 -0800 Subject: [PATCH 2/5] better --- crates/yakui-wgpu/shaders/main.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/yakui-wgpu/shaders/main.wgsl b/crates/yakui-wgpu/shaders/main.wgsl index 4e728401..deb6b8e2 100644 --- a/crates/yakui-wgpu/shaders/main.wgsl +++ b/crates/yakui-wgpu/shaders/main.wgsl @@ -35,7 +35,7 @@ fn vs_main( @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { var color = textureSample(color_texture, color_sampler, in.texcoord); - color *= vec4(vec3(in.color.a), 1.0); + color *= vec4(color.rgb * in.color.a, 1.0); return in.color * color; } \ No newline at end of file From d97033bcee3bf06f8cc8bd010cbf12cca1e1bc75 Mon Sep 17 00:00:00 2001 From: cybersoulK Date: Tue, 24 Dec 2024 15:53:27 -0800 Subject: [PATCH 3/5] . --- crates/yakui-wgpu/shaders/main.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/yakui-wgpu/shaders/main.wgsl b/crates/yakui-wgpu/shaders/main.wgsl index deb6b8e2..a8101ec0 100644 --- a/crates/yakui-wgpu/shaders/main.wgsl +++ b/crates/yakui-wgpu/shaders/main.wgsl @@ -35,7 +35,7 @@ fn vs_main( @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { var color = textureSample(color_texture, color_sampler, in.texcoord); - color *= vec4(color.rgb * in.color.a, 1.0); + color = vec4(color.rgb * in.color.a, in.color.a); return in.color * color; } \ No newline at end of file From 748aeda0511f3f1621c9ff29675c6b2524a5aa26 Mon Sep 17 00:00:00 2001 From: cybersoulK Date: Tue, 24 Dec 2024 15:59:50 -0800 Subject: [PATCH 4/5] ops --- crates/yakui-wgpu/shaders/main.wgsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/yakui-wgpu/shaders/main.wgsl b/crates/yakui-wgpu/shaders/main.wgsl index a8101ec0..c02223af 100644 --- a/crates/yakui-wgpu/shaders/main.wgsl +++ b/crates/yakui-wgpu/shaders/main.wgsl @@ -34,8 +34,9 @@ fn vs_main( @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { - var color = textureSample(color_texture, color_sampler, in.texcoord); - color = vec4(color.rgb * in.color.a, in.color.a); + + let sample = textureSample(color_texture, color_sampler, in.texcoord); + let color = vec4(sample.rgb * in.color.a, sample.a) * in.color; - return in.color * color; + return color; } \ No newline at end of file From f0a64b164838f2ce5789815d9194e07789598d34 Mon Sep 17 00:00:00 2001 From: cybersoulK Date: Tue, 24 Dec 2024 16:08:41 -0800 Subject: [PATCH 5/5] or this --- crates/yakui-wgpu/shaders/main.wgsl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/yakui-wgpu/shaders/main.wgsl b/crates/yakui-wgpu/shaders/main.wgsl index c02223af..fbe18734 100644 --- a/crates/yakui-wgpu/shaders/main.wgsl +++ b/crates/yakui-wgpu/shaders/main.wgsl @@ -34,9 +34,8 @@ fn vs_main( @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { - - let sample = textureSample(color_texture, color_sampler, in.texcoord); - let color = vec4(sample.rgb * in.color.a, sample.a) * in.color; + var color = textureSample(color_texture, color_sampler, in.texcoord); + color = vec4(color.rgb * in.color.a, color.a); - return color; + return in.color * color; } \ No newline at end of file