ShaderPreprocessor
class ShaderPreprocessor
Provides a high-level API to manage program template and generate shaders by passing macro data for the shader templates.
Constructor
new ShaderPreprocessor() → {}
Summary
Public Methods
static from(vertexTemplateSrc: string, fragmentTemplateSrc: string, name: string) → {ProgramTemplate}
Creates a program template for given shader template sources. It will return a memoized instance if the same sources are used together twice.
Name | Type | Attributes | Description |
---|---|---|---|
vertexTemplateSrc | string |
vertex template source |
|
fragmentTemplateSrc | string |
fragment template source |
|
name | string |
<optional> |
the name of the template |
Type | Description |
---|---|
ProgramTemplate |
static generateShader(vertexTemplateSrc: string, fragmentTemplateSrc: string, name: Record<string, any>) → {PIXI.Shader}
Name | Type | Description |
---|---|---|
vertexTemplateSrc | string |
the vertex shader template source |
fragmentTemplateSrc | string |
the fragment shader template source |
name | Record<string, any> |
custom name of the shader, if desired |
Type | Description |
---|---|
PIXI.Shader |