spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.18k stars 380 forks source link

remove extra *projectionmatrix in vertex shader #150

Open nshelton opened 2 years ago

nshelton commented 2 years ago

normal is already computed in clip space so why is it projected again using the projection matrix? This creates incorrect thickness in general but especially for sizeAttenuation to work as expected. Am I missing something magic here?

could be related to these https://github.com/spite/THREE.MeshLine/issues/49 https://github.com/spite/THREE.MeshLine/issues/52 https://github.com/spite/THREE.MeshLine/issues/136 https://github.com/spite/THREE.MeshLine/issues/132

I also noticed strange behavior when scaling meshlines causin the thickness to be unpredictable. So there may be other issues in the shader, I ended up just doing the calculations in world space for consistent (in world space) line width since I wasn't able to guarantee it with this shader

drcmda commented 1 year ago

i've merged your commit in https://github.com/pmndrs/meshline