Skip to content
Snippets Groups Projects
Unverified Commit 06d3a045 authored by John's avatar John Committed by GitHub
Browse files

Merge pull request #118 from mwbryant/transparency-fix

Fix transparency for type 0 quads
parents 0572f601 c66d437f
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,7 @@ fn fragment(in: VertexOutput) -> [[location(0)]] vec4<f32> { ...@@ -71,7 +71,7 @@ fn fragment(in: VertexOutput) -> [[location(0)]] vec4<f32> {
bs, bs,
); );
rect_dist = 1.0 - smoothStep(0.0, fwidth(rect_dist), rect_dist); rect_dist = 1.0 - smoothStep(0.0, fwidth(rect_dist), rect_dist);
return vec4<f32>(in.color.rgb, rect_dist); return vec4<f32>(in.color.rgb, rect_dist * in.color.a);
} }
if (quad_type.t == 1) { if (quad_type.t == 1) {
var px_range = 3.5; var px_range = 3.5;
...@@ -95,4 +95,4 @@ fn fragment(in: VertexOutput) -> [[location(0)]] vec4<f32> { ...@@ -95,4 +95,4 @@ fn fragment(in: VertexOutput) -> [[location(0)]] vec4<f32> {
return vec4<f32>(color.rgb * in.color.rgb, color.a * in.color.a * mask); return vec4<f32>(color.rgb * in.color.rgb, color.a * in.color.a * mask);
} }
return in.color; return in.color;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment