PDA

View Full Version : WebGL function error



g_khatwani
08-22-2012, 04:46 AM
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.

Regards,
Gaurav Khatwani

Ralph
08-22-2012, 05:16 AM
That error is thrown if Object.Vertices is undefined or not an array

g_khatwani
08-22-2012, 05:29 AM
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.

Regards,
Gaurav

g_khatwani
08-22-2012, 06:00 AM
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


this.GL.generateMipmap(this.GL.TEXTURE_2D);
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

Regards,
Gaurav

g_khatwani
08-23-2012, 02:30 AM
khronos, SteveBaker

Please help me for the above query

Ralph
08-23-2012, 02:53 AM
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. (http://learningwebgl.com/blog/?page_id=1217) That would give you a basic understanding to begin with.