diff --git a/src/core/Shader.js b/src/core/Shader.js index 8115ccd..d83ddda 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -37,10 +37,13 @@ * @param {WebGLRenderingContext} gl - The current WebGL rendering context * @param {string|string[]} vertexSrc - The vertex shader source as an array of strings. * @param {string|string[]} fragmentSrc - The fragment shader source as an array of strings. + * @param {object} [attributeLocations] - A key value pair showing which location eact attribute should sit. + e.g. {position:0, uvs:1}. + * @param {string} [precision] - The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'. */ - constructor(gl, vertexSrc, fragmentSrc) + constructor(gl, vertexSrc, fragmentSrc, attributeLocations, precision) { - super(gl, checkPrecision(vertexSrc, settings.PRECISION_VERTEX), - checkPrecision(fragmentSrc, settings.PRECISION_FRAGMENT)); + super(gl, checkPrecision(vertexSrc, precision || settings.PRECISION_VERTEX), + checkPrecision(fragmentSrc, precision || settings.PRECISION_FRAGMENT), undefined, attributeLocations); } }