多视角3D逼真HTML5水波动画

2020-04-24 18:56:57易采站长站整理

  this.textureB.drawTo(function() {   
    this_.textureA.bind();   
    this_.updateShader.uniforms({   
      delta: [1 / this_.textureA.width, 1 / this_.textureA.height]   
    }).draw(this_.plane);   
  });   
  this.textureB.swapWith(this.textureA);   
};   
  
Water.prototype.updateNormals = function() {   
  var this_ = this;   
  this.textureB.drawTo(function() {   
    this_.textureA.bind();   
    this_.normalShader.uniforms({   
      delta: [1 / this_.textureA.width, 1 / this_.textureA.height]   
    }).draw(this_.plane);   
  });   
  this.textureB.swapWith(this.textureA);   
};