title: Three js Shader Material modify depth buffer
body: <p>In Three js, I'm using a vertex shader to animate a large geometry.</p>
  
  <p>I've also set up a Depth of Field effect on the output.  The problem is that the Depth of Field effect doesn't seem to know about the changed positioning created in my vertex shader.  It is responding as if the geometry is in the original position.</p>
  
  <p>How can I update the depth information in my shader/material so that the DOF works correctly?  THREE.Material has a depthWrite property, but it doesn't seem to be that...</p>
  
  <p>My depth of field pass works like this:</p>
  
  <pre><code>renderer.render( this.originalScene, this.originalCamera, this.rtTextureColor, true );
  
  this.originalScene.overrideMaterial = this.material_depth;
  renderer.render( this.originalScene, this.originalCamera, this.rtTextureDepth, true );
  </code></pre>
  
  <p>rtTextureColor and rtTextureDepth are both WebGLRenderTargets. For some reason rtTextureColor is correct, but rtTextureDepth is not</p>
  
  <p>here is my vertex shader:</p>
  
  <pre><code>int sphereIndex = int(floor(position.x/10.));
  
              float displacementVal = displacement[sphereIndex].w;
              vec3 rotationDisplacement = displacement[sphereIndex].xyz;
  
              vNormal = normalize( normalMatrix * normal );
              vec3 vNormel = normalize( normalMatrix * viewVector );
              intensity = abs(pow( c - dot(vNormal, vNormel), p ));
  
  
              float xVal = (displacementVal*orbitMultiplier) * sin(timeValue*rotationDisplacement.x);
              float yVal = (displacementVal*orbitMultiplier) * cos(timeValue*rotationDisplacement.y);
              float zVal = 0;
  
              vec3 rotatePosition = vec3(xVal,yVal,zVal);
  
              vec3 newPos = (position-vec3((10.*floor(position.x/10.)),0,0))+rotatePosition;
              vec4 mvPosition;
              mvPosition = (modelViewMatrix *  vec4(newPos,1));
  
              vViewPosition = -mvPosition.xyz;
              vec4 p = projectionMatrix * mvPosition;
              gl_Position = p;
  </code></pre>