Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ArrayBufferView not big enough for request
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tomáš Sychra  
View profile  
 More options Sep 7 2012, 3:55 am
From: Tomáš Sychra <xsych...@gmail.com>
Date: Fri, 7 Sep 2012 00:55:32 -0700 (PDT)
Local: Fri, Sep 7 2012 3:55 am
Subject: ArrayBufferView not big enough for request

Hi,
can somebody help me please with this error : WebGL: INVALID_OPERATION:
texImage2D: ArrayBufferView not big enough for request ?
I don´t understand to that, because ArrayBuffer, that i want to paint isnt
big enaught (another one - more bigger - i can paint with any problems)..so
where could be problem?
Help me please...

code where the error is :

i called this :
textures.textureYZ.refreshTextureData(gl, texGen.generateYZTexture(),
cube3D.width, cube3D.numCuts, gl.RGBA);

refreshTexture method :
  /**
    * Actualize texture
    */
    function refreshTextureData(gl, dataArray, width, height, type) {
      gl.bindTexture(gl.TEXTURE_2D, texture);

// ----> HERE IS THE PROBLEM
gl.texImage2D(gl.TEXTURE_2D, 0, type, width, height, 0, type,
gl.UNSIGNED_BYTE, dataArray);

      //solution of Power of 2 only textures - we didnt REPEAT
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
      gl.bindTexture(gl.TEXTURE_2D, null);
    }  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
社用 Gregg Tavares  
View profile  
 More options Sep 7 2012, 12:22 pm
From: Gregg Tavares (社用) <g...@google.com>
Date: Fri, 7 Sep 2012 09:22:47 -0700
Local: Fri, Sep 7 2012 12:22 pm
Subject: Re: [webgl-dev-list] ArrayBufferView not big enough for request

The dataArray needs to be

   var unpackAlignment = gl.getParameter(gl.UNPACK_ALIGNMENT);
   var unpaddedRowSize = width * sizeofPixel(type, format);
   var paddedRowSize = Math.floor((width + unpackAlignment - 1) /
unpackAlignment)  * unpackAlignment;
   var sizeNeeded = paddedRowSize * (height - 1) + unpaddedRowSize;

I'm assuming you know the size of a pixel. for gl.RGBA, gl_UNSIGNED_BYTE it
would be 4
The default unpackAlignment is 4

Try printing the length of dataArray

Maybe you could paste a sample somewhere like jsfiddle.net?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »