WebGL function error

Hi All,

I am trying to use webGL function bufferdata and I am stuck at following error. Please let me know if anybody is aware of the same

this.GL.bufferData(this.GL.ARRAY_BUFFER, new Float32Array(Object.Vertices), this.GL.STATIC_DRAW);

Uncaught RangeError: ArrayBufferView size is not a small enough positive integer.

Gaurav Khatwani

That error is thrown if Object.Vertices is undefined or not an array

How to define Object.Vertices if i am trying to draw a cube.


I have resolved my Object.Vertices problem now I a getting following 3 warnings for respective code. I request you to please help me for that


WebGL: INVALID_OPERATION: generateMipmap: level 0 not power of 2 or not all the same size

var pmatrix = this.GL.getUniformLocation(this.ShaderProgram, "PerspectiveMatrix");
this.GL.uniformMatrix4fv(pmatrix, false, new Float32Array(PerspectiveMatrix));

WebGL: INVALID_VALUE: uniformMatrix4fv: invalid size

var tmatrix = this.GL.getUniformLocation(this.ShaderProgram, "TransformationMatrix");
this.GL.uniformMatrix4fv(tmatrix, false, new Float32Array(TransformMatrix));

WebGL: INVALID_VALUE: uniformMatrix4fv: invalid size


khronos, SteveBaker

Please help me for the above query

Nobody can really help you here. These error messages clearly state what’s wrong. Textures should have a size of a power of 2 and the matrices are 4x4 so 16 values. Not being rude but maybe you should have a look at these tutorials. That would give you a basic understanding to begin with.