Starting from version 0.137 fog with non transparent materials does not work correctly

I created 2 planes and loaded a transparent texture as a map. The left plane has MeshBasicMaterial with transparent == false. The right plane has a ShaderMaterial with transparent == false. Also I added THREE.Fog with the same color as the background. In following screen you can see what its look like

Then I moved the camera away and the planes disappeared under the influence of fog(three.js version == 0.136) and moved the camera away from planes and under the influence of fog they disappeared as it should.
image

Then I changed three.js version on 0.137 and moved the camera away from planes and got following result. Under the influence of fog they turned white.

Then I changed three.js version on 0.138 and moved the camera away from planes and got following result. Under the influence of fog mesh with ShaderMaterial turned white while mesh with MeshBasicMaterial just disappeaed as it should.

Also I created a sandbox with the problem(three js version == 0.137)

add this line to fix your shader in codesandbox:

1 Like