Skip to content

Commit 94c51f5

Browse files
committed
fix rendering p1 quads
1 parent 65ba738 commit 94c51f5

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

ngsolve_webgpu/shaders/mesh/utils.wgsl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,13 @@ fn calcTriLam(tri: Triangle, vertexId: u32, h: f32) -> vec2<f32> {
122122
let i3 = vertexId % 3u;
123123
var lam = vec2f(0.0, 0.0);
124124

125-
if(tri.npElement ==3) {
126-
if (i3) < 2 {
127-
lam[i3] += h;
128-
}
125+
if(tri.npElement == 3) {
126+
if (i3 == 0u) { lam.x += h; }
127+
else if (i3 == 1u) { lam.y += h; }
129128
}
130129
else {
131-
if(i3 > 0u) {
132-
lam[i3-1] += h;
133-
}
130+
if (i3 == 1u) { lam.x += h; }
131+
else if (i3 == 2u) { lam.y += h; }
134132
}
135133

136134
return lam;

0 commit comments

Comments
 (0)