Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

June 28 2010

15:12

Crash in glDrawElements() using VBOs just after glBufferData()

The OpenGL wrappers take the data pointer passed in by those sorts of
methods using native GetDirectBufferAddress of the corresponding type
(int or float) and pass that pointer into the native gl method. That
only works correctly if it's a direct buffer.
I just checked android_opengl_GLES10.cpp and GLES11.cpp and found that
glTexImage2D and glBufferData use the same getPointer() method to get
to the data. That means that behavior should be the same.
Ultimately, the data comes from:
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *)
0);
return (void *) ((char *) data + offset);
then the gl method is called, then the pointer is released.
Always use direct buffers when working with any aspect of OpenGL on
Android.
15:05

Do VBOs really improve performance? Really?

VBOs are designed to reduce bus bandwidth usage for static geometry.
If you're not pushing too much across that bus (as in the case of
quads or very few, very low poly objects), they won't do much. If, on
the other hand, you're actually running static scenes that are moving
5k polys per draw eg (7.5k verts, 7.5k normals, 15k indices, 7.5k UVs)
= 270Kb, you will most likely see some sort of improvement, especially
on chips like the qualcomms as they have fairly slow transfers. Just
think, 270Kb @30fps = 8.1Mb of memory copying per second you're saving
using VBOs.
15:04

OpenGL poor performance with textures?

To summarize:
- use mipmapping for scaled down quads, nearest filtering for pixel
perfect screen aligned quads
- use 16-bit argb/rgb textures instead of 32-bit argb textures
That's all you can do. The PowerVR in the droid is a beast and will
happily transform as many vertices as you throw at it, i have yet to
encounter an issue with that rendering stage. Fetching texels is
expensive though so avoid it at all cost :)

October 21 2009

18:41

October 18 2009

18:59

Forays Into iPhone OpenGL ES | Serg Koren

If you create, build and run the sample template you end up with an iPhone application that spins a multicolored square... Part I - The iPhone OpenGL ES XCode Template Header Dissected
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.