Results 1 to 6 of 6

Thread: WebGL function error

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    5

    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

    Code :
    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

  2. #2
    Junior Member
    Join Date
    Mar 2011
    Posts
    17

    Re: WebGL function error

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

  3. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Re: WebGL function error

    Quote Originally Posted by Ralph
    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

  4. #4
    Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Re: WebGL function error

    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

    Code :
    this.GL.generateMipmap(this.GL.TEXTURE_2D);
    WebGL: INVALID_OPERATION: generateMipmap: level 0 not power of 2 or not all the same size

    Code :
    var pmatrix = this.GL.getUniformLocation(this.ShaderProgram, "PerspectiveMatrix");
    this.GL.uniformMatrix4fv(pmatrix, false, new Float32Array(PerspectiveMatrix));
    WebGL: INVALID_VALUE: uniformMatrix4fv: invalid size

    Code :
    var tmatrix = this.GL.getUniformLocation(this.ShaderProgram, "TransformationMatrix");
    this.GL.uniformMatrix4fv(tmatrix, false, new Float32Array(TransformMatrix));
    WebGL: INVALID_VALUE: uniformMatrix4fv: invalid size

    Regards,
    Gaurav

  5. #5
    Junior Member
    Join Date
    Aug 2012
    Posts
    5

    Re: WebGL function error

    khronos, SteveBaker
    Please help me for the above query

  6. #6
    Junior Member
    Join Date
    Mar 2011
    Posts
    17

    Re: WebGL function error

    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.

Similar Threads

  1. Replies: 3
    Last Post: 11-02-2011, 09:28 PM
  2. clBuildProgram() function error...!!
    By phoebe0105 in forum OpenCL
    Replies: 3
    Last Post: 05-13-2010, 07:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •