diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-05-31 10:22:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 10:22:28 +0200 |
| commit | fb1bfc762c89cd8c5bd745a82998c1662a1bf196 (patch) | |
| tree | 0ece4f99d458f47f1408c78f79b85345036d3671 /src_testbed/lines/debuglines.wgsl | |
| parent | c630635e57624385123b4a0fb658018bc6fdba91 (diff) | |
| parent | 0640f5e660aef579a9e6b134b7066e9bcae32b8b (diff) | |
| download | rapier-fb1bfc762c89cd8c5bd745a82998c1662a1bf196.tar.gz rapier-fb1bfc762c89cd8c5bd745a82998c1662a1bf196.tar.bz2 rapier-fb1bfc762c89cd8c5bd745a82998c1662a1bf196.zip | |
Merge pull request #334 from dimforge/fixes
Some CCD and debug-render improvements
Diffstat (limited to 'src_testbed/lines/debuglines.wgsl')
| -rw-r--r-- | src_testbed/lines/debuglines.wgsl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src_testbed/lines/debuglines.wgsl b/src_testbed/lines/debuglines.wgsl index 0987839..364d9ac 100644 --- a/src_testbed/lines/debuglines.wgsl +++ b/src_testbed/lines/debuglines.wgsl @@ -25,9 +25,13 @@ struct FragmentOutput { fn vertex(vertex: Vertex) -> VertexOutput { var out: VertexOutput; out.clip_position = view.view_proj * vec4<f32>(vertex.pos, 1.0); - //out.color = vertex.color; // https://github.com/bevyengine/bevy/blob/328c26d02c50de0bc77f0d24a376f43ba89517b1/examples/2d/mesh2d_manual.rs#L234 - out.color = vec4<f32>((vec4<u32>(vertex.color) >> vec4<u32>(8u, 8u, 16u, 24u)) & vec4<u32>(255u)) / 255.0; + // ... except the above doesn't seem to work in 3d. Not sure what's going on there. + var r = f32(vertex.color & 255u) / 255.0; + var g = f32(vertex.color >> 8u & 255u) / 255.0; + var b = f32(vertex.color >> 16u & 255u) / 255.0; + var a = f32(vertex.color >> 24u & 255u) / 255.0; + out.color = vec4<f32>(r, g, b, a); return out; } |
