PIXI.BatchPluginFactory
class BatchPluginFactory
Constructor
new PIXI.BatchPluginFactory() → {}
Summary
Properties from BatchPluginFactory
string |
|
string |
|
Methods from BatchPluginFactory
unknown |
|
Public Properties
static defaultFragmentTemplate: string
The default fragment shader source
static defaultVertexSrc: string
The default vertex shader source
Public Methods
static create(options: object) → {unknown}
Create a new BatchRenderer plugin for Renderer. this convenience can provide an easy way to extend BatchRenderer with all the necessary pieces.
const fragment = `
varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;
uniform sampler2D uSamplers[%count%];
void main(void){
vec4 color;
%forloop%
gl_FragColor = vColor * vec4(color.a - color.rgb, color.a);
}
`;
const InvertBatchRenderer = PIXI.BatchPluginFactory.create({ fragment });
PIXI.extensions.add({
name: 'invert',
ref: InvertBatchRenderer,
type: PIXI.ExtensionType.RendererPlugin,
});
const sprite = new PIXI.Sprite();
sprite.pluginName = 'invert';
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options | object |
<optional> |
||
options.vertex | string |
<optional> |
PIXI.BatchPluginFactory.defaultVertexSrc |
Vertex shader source |
options.fragment | string |
<optional> |
PIXI.BatchPluginFactory.defaultFragmentTemplate |
Fragment shader template |
options.vertexSize | number |
<optional> |
6 |
Vertex size |
options.geometryClass | object |
<optional> |
PIXI.BatchGeometry |
Type | Description |
---|---|
unknown |
New batch renderer plugin |