Why outline do not support black color?

The website address: https://threejs.org/examples/?q=outline#webgl_postprocessing_outline
In this demo,if i set edgecolor to black,the outline will almost disappear.I do not got any idea after browsed the source code OutlinePass.js.Looking forward to your answer,Thanks a lot.

I think its because of

 blending: THREE.AdditiveBlending,

Inside OutlinePass.js -> getOverlayMaterial() method

Try changing it to:

blending: THREE.MultiplyBlending,

@MateuszWis Have you actually tested this recommendation?

@Mugen87 No, I haven’t, also even if i’m right it won’t work properly with other colors then black

Well, this happens when you change the blending to THREE.MultiplyBlending.

https://jsfiddle.net/uv7ahLf4/3/

2 Likes

Got it working now

gl_FragColor = vec4(vec3(1.0),0.0) - finalColor;\

(thats the last line of fragmentShader from getOverlayMaterial function)

https://jsfiddle.net/uv7ahLf4/5/

4 Likes

It’s very kind of you.I can run it now.

its working thanks