PDA

View Full Version : GPU terrain rendering



miroslav_karpis
06-02-2010, 12:48 PM
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..

enot
06-02-2010, 11:54 PM
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.

miroslav_karpis
06-03-2010, 11:31 AM
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.

miroslav_karpis
06-11-2010, 12:32 AM
figured it out - not correct IBO values :x

- if anybody is interested here is the link (http://eisbergstudio.com/dev/) - just finished with first block 64x64