ShaderPasses constructor

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

Implementation

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

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

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

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

  fsQuad = FullScreenQuad(material);
  renderTargetsPass = {};
}