FilmPass constructor

FilmPass(
  1. dynamic noiseIntensity,
  2. dynamic scanlinesIntensity,
  3. dynamic scanlinesCount,
  4. dynamic grayscale,
)

Implementation

FilmPass(
  noiseIntensity,
  scanlinesIntensity,
  scanlinesCount,
  grayscale,
) : super() {
  var shader = filmShader;

  uniforms = UniformsUtils.clone(Map<String, dynamic>.from(shader["uniforms"]));

  material = ShaderMaterial({
    "uniforms": uniforms,
    "vertexShader": shader["vertexShader"],
    "fragmentShader": shader["fragmentShader"],
  });

  if (grayscale != null) uniforms["grayscale"]["value"] = grayscale;
  if (noiseIntensity != null) {
    uniforms["nIntensity"]["value"] = noiseIntensity;
  }
  if (scanlinesIntensity != null) {
    uniforms["sIntensity"]["value"] = scanlinesIntensity;
  }
  if (scanlinesCount != null) {
    uniforms["sCount"]["value"] = scanlinesCount;
  }

  fsQuad = FullScreenQuad(material);
}