[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] VBO with 16 or 8 bit data incredibly slow




Thanks to all for your tips, it works now :)

Best regards
Yvonne

Am 09.07.2012 19:07, schrieb Jeff Russell:
Written with apple devices in mind, but good advice generally:
http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesforWorkingwithVertexData/TechniquesforWorkingwithVertexData.html


On Mon, Jul 9, 2012 at 12:28 PM, Patrick Baggett <baggett.patrick@gmail.com>wrote:

And to clarify, that is each attribute type "position", "texture coords",
etc. that should begin on 4-byte boundary, not each *element* of that
datum (otherwise shorts wouldn't save memory bandwidth!)

Patrick


On Mon, Jul 9, 2012 at 11:26 AM, Patrick Baggett < baggett.patrick@gmail.com> wrote:

I recall Apple's documentation for iPhone/iPad using the PowerVR GPU to
do the following:

1) Interleave data
2) Ensure that each datum begins on a 4-byte boundary.

For example:

Interleaved position/ ST coords

[X][Y][Z][S][T]

GL_FLOAT: ST begins at offset = 12. 12 % 4 == 0.
GL_SHORT: ST begins at offset = 6. This isn't a multiple of 4 bytes, so
there is a perf. penalty.


Your model has what, 1.5M triangles? If there is a per-vertex penalty due to something like this, the total penalty could grow huge. I've have good results with using GL_SHORT on the iPhone, but I did also reorder stuff so that it followed all of Apple's rules.


Patrick


On Mon, Jul 9, 2012 at 11:11 AM, Yvonne Jung < yvonne.jung@igd.fraunhofer.de> wrote:

Hello all,

to improve bandwidth and memory, we tried to pass 16 and 8 bit encoded
attribute data via the gl.vertexAttribPointer() call.
According to the WebGL specification you can use e.g. SHORT and BYTE as
data type, too, and on NVidia hardware this performs very good.
However, using a computer with ATI card -- or the iPad 3 -- it is
incredibly _slow_: instead of real-time framerates as for the same model
using FLOAT buffers, we don't even get 1 fps with Int18 or Int8 buffers.

Does ATI or the iPad's GPU require 32-bit alignment or might something
else be the problem?
If you want to have a look at the models -- here is the link to the
model using float buffers, which performs fine everywhere:
http://examples.x3dom.org/**buddha/model-bg.html<http://examples.x3dom.org/buddha/model-bg.html>
And here is the link to the same model using short and char buffers,
which only performs good on NVidia GPUs:
http://examples.x3dom.org/**buddha/model-bgC.html<http://examples.x3dom.org/buddha/model-bgC.html>

Regards
Yvonne

------------------------------**-----------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
------------------------------**-----------------------------




----------------------------------------------------------- You are currently subscribed to public_webgl@khronos.org. To unsubscribe, send an email to majordomo@khronos.org with the following command in the body of your email: unsubscribe public_webgl -----------------------------------------------------------