4x4 box blur shader which works in conjunction with a 50% rescale.

Hierarchy (View Summary)

Indexable

  • [x: string]: unknown

Constructors

Properties

gl: WebGLRenderingContext
isShader: true
type: undefined
fragmentShaderSource: string

Fragment Shader GLSL Source Code

This static property is overridden by subclass shaders to the GLSL source code for a Fragment Shader program.

MyShader.fragmentShaderSource = `
#ifdef GL_ES
# ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
# else
precision lowp float;
# endif
#endif
varying vec2 vTextureCoord;
varying vec4 vColor;
uniform sampler2D uSampler;
void main(void){
gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor;
}
`;
vertexShaderSource: string

Vertex Shader GLSL Source Code

This default shader program is replaced by subclass shaders to the GLSL source code for a Vertex Shader program.

DefaultShader.vertexShaderSource = `
#ifdef GL_ES
# ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
# else
precision lowp float;
# endif
#endif
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
attribute vec4 aColor;
uniform vec2 projection;
varying vec2 vTextureCoord;
varying vec4 vColor;
void main(void){
gl_Position = vec4(aVertexPosition.x * projection.x - 1.0, aVertexPosition.y * -abs(projection.y) + 1.0, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vColor = aColor;
gl_Position.y = -sign(projection.y) * gl_Position.y;
}
`;

Methods