|
@@ -187,11 +187,12 @@
|
|
|
clothTexture.wrapS = clothTexture.wrapT = THREE.RepeatWrapping;
|
|
|
clothTexture.anisotropy = 16;
|
|
|
|
|
|
- var clothMaterial = new THREE.MeshPhongMaterial( { alphaTest: 0.5, color: 0xffffff, specular: 0x030303, emissive: 0x111111, shininess: 10, map: clothTexture, side: THREE.DoubleSide } );
|
|
|
+ var clothMaterial = new THREE.MeshPhongMaterial( { alphaTest: 0.5, color: 0xffffff, specular: 0x030303, emissive: 0x111111, shiness: 10, map: clothTexture, side: THREE.DoubleSide } );
|
|
|
|
|
|
// cloth geometry
|
|
|
clothGeometry = new THREE.ParametricGeometry( clothFunction, cloth.w, cloth.h );
|
|
|
- clothGeometry = new THREE.DirectGeometry().fromGeometry( clothGeometry );
|
|
|
+ clothGeometry.dynamic = true;
|
|
|
+ clothGeometry.computeFaceNormals();
|
|
|
|
|
|
var uniforms = { texture: { type: "t", value: clothTexture } };
|
|
|
var vertexShader = document.getElementById( 'vertexShaderDepth' ).textContent;
|
|
@@ -348,6 +349,9 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ clothGeometry.computeFaceNormals();
|
|
|
+ clothGeometry.computeVertexNormals();
|
|
|
+
|
|
|
clothGeometry.normalsNeedUpdate = true;
|
|
|
clothGeometry.verticesNeedUpdate = true;
|
|
|
|