GPU terrain rendering

Hi All,

I would like to ask you for following help. I’m trying to make a GPU terrain rendering (algorithm from NVIDIA Gems). Currently now I’m just porting code from OpenGL to WebGL and I’m having following issue:

  • VBO is loaded
  • IBO is also loaded
    but nothing is drew.

I’m using 2D arrays to store VBO and IBO (this everything worked well in OpenGL) + when I check the values they are correct.

I think that the problem can be in: - is the size in bufferData set correctly?
gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray(vboBuffer), gl.STATIC_DRAW);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedShortArray(iboBuffer), gl.STATIC_DRAW);

or here: - value 8193 is used in OpenGL
gl.drawElements(gl.TRIANGLE_STRIP, 8193, gl.UNSIGNED_SHORT, 0);

The code is here: http://eisbergstudio.com/dev/

any help more than welcome…

FireFox Error Console message:
DrawElements: bound element array buffer is too small for given count and offset
You can try draw e.g. 8 elements.

thanks,…but this ´message´(its not warning or error) is displayed also on other examples from webgl wiki. I wil try to get glGetError and see.
For example in chrome I´m not getting errors at all.

figured it out - not correct IBO values :x

  • if anybody is interested here is the link - just finished with first block 64x64