Search code examples
three.jspost-processing

remove hiddenEdgeColor from outlinePass in three.js


I'm using the outlinePass in a three.js project and it has a feature to show the outline of geometry that is behind another in different color, but I don't want this hidden outline at all. How do I remove this?

For example, I don't want the Red outline in below screenshot:

Three.js outline effect


Solution

  • You can achieve this by setting the hiddenEdgeColor to black

    outlinePass.hiddenEdgeColor.set(new Color('black'))
    

    Check below screenshot:

    Three.js outline pass screenshot with no hidden edge color