How to combine Fog with Outline Effect

outline
#1

Hi all,

As soon as I add Fog to my scene, the outline effect is gone. Is there a way to keep the effect and still add fog?

#2

Are you talking about the class OutlineEffect or the outline effect achieved via post processing via OutlinePass?

#3

The OutlineEffect - I totally love it, it is simpy the best edge rendering option out there. It was one of my top reasons to use THREE.JS for my project instead of Unreal, Unity or other WebGL engines. But it has not been an easy road to combine it with other stuff like the postprocessing stack…

#4

This looks like a bug. I’ve tested with the webgl_loader_mmd example and get the following runtime error when using fog.

THREE.WebGLShader: Shader couldn’t compile.
three.js:16878 THREE.WebGLShader: gl.getShaderInfoLog() vertex ERROR: 0:202: ‘fogDepth’ : redefinition

Please file an issue at github. This needs to be fixed in OutlineEffect.

2 Likes