spite / THREE.MeshLine

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

outline pass not work with meshline #125

Open ily1437 opened 3 years ago

ily1437 commented 3 years ago

I am using both meshline and outline pass in three.js but found outline pass does not work with meshline. Is there a way to resolve it?

FadedWeiss commented 3 years ago

I got the same problem. Even though the depthTest and depthWrite of the MeshLineMaterial is true, the outline pass won't work.

ily1437 commented 3 years ago

I got the same problem. Even though the depthTest and depthWrite of the MeshLineMaterial is true, the outline pass won't work.

I have found the key points. The shader of outline pass only worked for standard view-model transform, so that it did not work for meshline or sprite either. In order to resolve it, I coded two vert-shaders for them, and fixed meshes type checking in outline render function. then it worked for them.

FadedWeiss commented 3 years ago

I got the same problem. Even though the depthTest and depthWrite of the MeshLineMaterial is true, the outline pass won't work.

I have found the key points. The shader of outline pass only worked for standard view-model transform, so that it did not work for meshline or sprite either. In order to resolve it, I coded two vert-shaders for them, and fixed meshes type checking in outline render function. then it worked for them.

I knew the type checking in outline render function. But what's wrong with view-model transform ? Could you show more details?