Three MeshLine Clipping Support

I am using the three.meshline package I’m trying to set clipping planes on the MeshLineMaterial. There is an open ticket here: Support for clipping planes · Issue #33 · spite/THREE.MeshLine · GitHub.

I tried adding that suggested code change into the fragment shader, but I get errors.

ERROR: 0:96: 'useClippingPlane' : undeclared identifier
ERROR: 0:96: 'vPosition' : undeclared identifier
ERROR: 0:96: 'clippingPlane' : undeclared identifier

etc. Which makes sense since those values are nowhere in the shader (or file for that matter).

I am wondering if there is a better approach to setting the clipping planes than in the fragment shader?

If the fragment shader is the way, can anyone point me in the proper direction?

I have also tried this fork: GitHub - lume/three-meshline: Mesh-based replacement for `THREE.Line` to allow lines thicker than 1 pixel and other features. (with related issue: Support Clipping Planes · Issue #8 · lume/three-meshline · GitHub) - same result.

I also tried: GitHub - pmndrs/meshline: 🪱 Mesh replacement for THREE.Line with the same result (no clipping).

Thanks for your help!

Also to note - I have tried fatlines, and while they clip somewhat - they do not clip entirely (small portions of the line extend past the clipping plane periodically for a small segment and then go away).

If either the MeshLine or Fatlines would work with the clipping I would be happy - I don’t have a preference really one way or another… I just need a line with variable thickness!

could you have make a super simple codesandbox where clipping is set up? the meshline library is dead and lives on at pmndrs, it accepts changes and pull requests. i’m guessing it’s just this feat: clipping support by drcmda · Pull Request #15 · pmndrs/meshline · GitHub but i have too little experience with clipping to test.

figured out how to test it, it works it’s merged and published

1 Like