ShaderPasses constructor

ShaderPasses(
  1. dynamic shader,
  2. dynamic textureID
)

Implementation

ShaderPasses(shader, textureID) : super() {
  this.textureID = (textureID != null) ? textureID : 'tDiffuse';

  this.uniforms = UniformsUtils.clone(shader["uniforms"]);
  passes = shader["passes"];

  this.clearColor = new Color(0, 0, 0);
  this.oldClearColor = Color.fromHex(0xffffff);

  Map<String, dynamic> _defines = {};
  _defines.addAll(shader["defines"] ?? {});
  this.material = new ShaderMaterial({
    "defines": _defines,
    "uniforms": this.uniforms,
    "vertexShader": shader["vertexShader"],
    "fragmentShader": shader["fragmentShader"]
  });

  this.fsQuad = new FullScreenQuad(this.material);
  this.renderTargetsPass = {};
}