SMAAPass constructor

SMAAPass(
  1. dynamic width,
  2. dynamic height
)

Implementation

SMAAPass(width, height) : super() {
  // render targets
  edgesRT = WebGLRenderTarget(
      width,
      height,
      WebGLRenderTargetOptions(
          {"depthBuffer": false, "generateMipmaps": false, "minFilter": LinearFilter, "format": RGBFormat}));
  edgesRT.texture.name = 'SMAAPass.edges';

  weightsRT = WebGLRenderTarget(
      width,
      height,
      WebGLRenderTargetOptions(
          {"depthBuffer": false, "generateMipmaps": false, "minFilter": LinearFilter, "format": RGBAFormat}));
  weightsRT.texture.name = 'SMAAPass.weights';

  // var areaTextureImage = new Image();
  // areaTextureImage.src = this.getAreaTexture();
  // areaTextureImage.onload = () {

  // 	// assigning data to HTMLImageElement.src is asynchronous (see #15162)
  // 	this.areaTexture.needsUpdate = true;

  // };

  areaTexture = Texture(null, null, null, null, null, null, null, null, null, null);
  areaTexture.name = 'SMAAPass.area';
  // this.areaTexture.image = areaTextureImage;
  areaTexture.format = RGBFormat;
  areaTexture.minFilter = LinearFilter;
  areaTexture.generateMipmaps = false;
  areaTexture.flipY = false;

  // var searchTextureImage = new Image();
  // searchTextureImage.src = this.getSearchTexture();
  // searchTextureImage.onload = () {
  // 	// assigning data to HTMLImageElement.src is asynchronous (see #15162)
  // 	this.searchTexture.needsUpdate = true;
  // };

  searchTexture = Texture(null, null, null, null, null, null, null, null, null, null);
  searchTexture.name = 'SMAAPass.search';
  // this.searchTexture.image = searchTextureImage;
  searchTexture.magFilter = NearestFilter;
  searchTexture.minFilter = NearestFilter;
  searchTexture.generateMipmaps = false;
  searchTexture.flipY = false;

  // materials - pass 1

  // if ( SMAAEdgesShader == null ) {
  // 	print( 'THREE.SMAAPass relies on SMAAShader' );
  // }

  // this.uniformsEdges = UniformsUtils.clone( SMAAEdgesShader.uniforms );

  // this.uniformsEdges[ 'resolution' ].value.set( 1 / width, 1 / height );

  // this.materialEdges = new ShaderMaterial( {
  // 	defines: Object.assign( {}, SMAAEdgesShader.defines ),
  // 	uniforms: this.uniformsEdges,
  // 	vertexShader: SMAAEdgesShader.vertexShader,
  // 	fragmentShader: SMAAEdgesShader.fragmentShader
  // } );

  // // materials - pass 2

  // this.uniformsWeights = UniformsUtils.clone( SMAAWeightsShader.uniforms );

  // this.uniformsWeights[ 'resolution' ].value.set( 1 / width, 1 / height );
  // this.uniformsWeights[ 'tDiffuse' ].value = this.edgesRT.texture;
  // this.uniformsWeights[ 'tArea' ].value = this.areaTexture;
  // this.uniformsWeights[ 'tSearch' ].value = this.searchTexture;

  // this.materialWeights = new ShaderMaterial( {
  // 	defines: Object.assign( {}, SMAAWeightsShader.defines ),
  // 	uniforms: this.uniformsWeights,
  // 	vertexShader: SMAAWeightsShader.vertexShader,
  // 	fragmentShader: SMAAWeightsShader.fragmentShader
  // } );

  // // materials - pass 3

  // this.uniformsBlend = UniformsUtils.clone( SMAABlendShader.uniforms );

  // this.uniformsBlend[ 'resolution' ].value.set( 1 / width, 1 / height );
  // this.uniformsBlend[ 'tDiffuse' ].value = this.weightsRT.texture;

  // this.materialBlend = new ShaderMaterial( {
  // 	uniforms: this.uniformsBlend,
  // 	vertexShader: SMAABlendShader.vertexShader,
  // 	fragmentShader: SMAABlendShader.fragmentShader
  // } );

  needsSwap = false;

  fsQuad = FullScreenQuad(null);
}