Browse Source

Fix uniforms to support fog

Fixed uniforms of conditionalEdgeMaterial to support fog.
I think this is a bug, because its VertShader and FragShader is already support fog.
lk-lkaz 4 years ago
parent
commit
d9fa714202
1 changed files with 11 additions and 7 deletions
  1. 11 7
      examples/js/loaders/LDrawLoader.js

+ 11 - 7
examples/js/loaders/LDrawLoader.js

@@ -998,14 +998,18 @@ THREE.LDrawLoader = ( function () {
 				edgeMaterial.userData.conditionalEdgeMaterial = new THREE.ShaderMaterial( {
 					vertexShader: conditionalLineVertShader,
 					fragmentShader: conditionalLineFragShader,
-					uniforms: {
-						diffuse: {
-							value: new THREE.Color( edgeColour )
-						},
-						opacity: {
-							value: alpha
+					uniforms: THREE.UniformsUtils.merge( [
+						THREE.UniformsLib.fog,
+						{
+							diffuse: {
+								value: new THREE.Color( edgeColour )
+							},
+							opacity: {
+								value: alpha
+							}
 						}
-					},
+					] ),
+					fog: true,
 					transparent: isTransparent,
 					depthWrite: ! isTransparent
 				} );