WebGLShadowMap constructor

WebGLShadowMap(
  1. WebGLRenderer _renderer,
  2. WebGLObjects _objects,
  3. WebGLCapabilities _capabilities
)

Implementation

WebGLShadowMap(this._renderer, this._objects, this._capabilities) {
  _maxTextureSize = _capabilities.maxTextureSize;

  _depthMaterial = MeshDepthMaterial({"depthPacking": RGBADepthPacking});
  _distanceMaterial = MeshDistanceMaterial(null);

  shadowMaterialVertical = ShaderMaterial({
    "defines": {"VSM_SAMPLES": 8},
    "uniforms": {
      "shadow_pass": {"value": null},
      "resolution": {"value": Vector2(null, null)},
      "radius": {"value": 4.0}
    },
    "vertexShader": vsmCert,
    "fragmentShader": vsmFrag
  });

  var float32List = Float32Array.from([-1.0, -1.0, 0.5, 3.0, -1.0, 0.5, -1.0, 3.0, 0.5]);

  fullScreenTri.setAttribute('position', Float32BufferAttribute(float32List, 3, false));

  fullScreenMesh = Mesh(fullScreenTri, shadowMaterialVertical);

  shadowMaterialHorizontal = shadowMaterialVertical.clone();
  shadowMaterialHorizontal.defines!["HORIZONTAL_PASS"] = 1;

  scope = this;
}