ShaderPass constructor

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

Implementation

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

  if (shader.runtimeType.toString() == "ShaderMaterial") {
    uniforms = shader.uniforms;

    material = shader;
  } else if (shader != null) {
    uniforms = UniformsUtils.clone(shader["uniforms"]);

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

  fsQuad = FullScreenQuad(material);
}