Module Filter-PIXI
class type _t = { ... }type t= Js.t(_t);Filter is a special type of WebGL shader that is applied to the screen. Example of the BlurFilter.
module Impl: { ... };include PIXI.Shader.Impl;
let create: ?program:Js.t(PIXI.Program._t) => ?uniforms:'a => unit => PIXI.Shader.t;let getProgram: Js.t(PIXI.Shader._t) => Js.t(PIXI.Program._t);let setProgram: Js.t(PIXI.Shader._t) => Js.t(PIXI.Program._t) => unit;let getUniforms: Js.t(PIXI.Shader._t) => 'a;let from: ?vertexSrc:string => ?fragmentSrc:string => ?uniforms:'a => unit => Js.t(PIXI.Shader._t);
include Impl;
let create: ?vertexSrc:string => ?fragmentSrc:string => ?uniforms:'a => unit => t;creates a new filter
- parameter vertexSrc
The source of the vertex shader
- parameter fragmentSrc
The source of the fragment shader
- parameter uniforms
Custom uniforms to use to augment the built-in ones
let getAutoFit: Js.t(_t) => bool;If enabled, PixiJS will fit the filter area into boundaries for better performance. Switch it off if it does not work for specific shader.
let setAutoFit: Js.t(_t) => bool => unit;If enabled, PixiJS will fit the filter area into boundaries for better performance. Switch it off if it does not work for specific shader.
let _getBlendMode: Js.t(_t) => int;
let getBlendMode: Js.t(_t) => PIXI.BLEND_MODES.t;Returns the blendmode of the filter
let _setBlendMode: Js.t(_t) => int => int;
let setBlendMode: Js.t(_t) => PIXI.BLEND_MODES.t => int;Sets the blendmode of the filter
let getEnabled: Js.t(_t) => bool;If enabled is true the filter is applied, if false it will not.
let setEnabled: Js.t(_t) => bool => unit;If enabled is true the filter is applied, if false it will not.
let getLegacy: Js.t(_t) => bool;Legacy filters use position and uvs from attributes
let getPadding: Js.t(_t) => float;The padding of the filter. Some filters require extra space to breath such as a blur. Increasing this will add extra width and height to the bounds of the object that the filter is applied to
let setPadding: Js.t(_t) => float => unit;The padding of the filter. Some filters require extra space to breath such as a blur. Increasing this will add extra width and height to the bounds of the object that the filter is applied to
let getResolution: Js.t(_t) => float;The resolution of the filter. Setting this to be lower will lower the quality but increase the performance of the filter.
let setResolution: Js.t(_t) => float => unit;The resolution of the filter. Setting this to be lower will lower the quality but increase the performance of the filter.
let getState: Js.t(_t) => Js.t(PIXI.State.#_t);The WebGL state the filter requires to render
let setState: Js.t(_t) => Js.t(PIXI.State.#_t) => unit;The WebGL state the filter requires to render
let apply: Js.t(_t) => filterManager:PIXI.Systems.FilterSystem.t => input:PIXI.RenderTexture.t => output:PIXI.RenderTexture.t => clear:bool => ?currentState:'a => unit => unit;Applies the filter
- parameter filterManager
The renderer to retrieve the filter from
- parameter input
The input render target
- parameter output
The target to output to
- parameter clear
Should the output be cleared before rendering to it
- parameter currentState
It's current state of filter. There are some useful properties in the currentState : target, filters, sourceFrame, destinationFrame, renderTarget, resolution