29.09.2011 23:01, MobileVisuals ?????:
I claim that HTC HD doesn't support OpenGL ES 2.0, because size
attenuation is a part of OpenGL ES 1.1 and it is not supported.
Quite possibly, you're right...
So HTC hasn't implemented the things that they say in the
specification, but why not?
Who knows?
You could contact their support, but even if they provide a plausible
answer (and that's a big "if"), it's not going to magically fix all the
HTC devices out there...
Thanks for the idea, do you mean like this?
Scale to small size if the sprite is far away.
Scale to medium size if the sprite is medium distance.
Scale to big size if the sprite is close.
More or less - you are currently doing continuous range scaling of your
sprites (I presume). If you replace them with texture mapped quads, you
could always use the same image, or pick one of the ones predefined at
various scale factors, to improve the image quality and performance.
Sort of like mip-mapping.
But that's not the core idea - the main thing is to replace attenuated
points with texture mapped quads.
That could work for other animations, but it would be very slow for my
star cluster animations. There are hundreds of stars in each cluster.
As it is now, I draw each star cluster in one single glDrawArrays
call. That makes it fast.
Hundreds doesn't sound too bad - at those poly counts, it's the fill
rate (overdraw) that can kill performance. But since sprites are
typically small, it probably won't be an issue.
Wouldn't I have to make one glDrawArrays call for each one of the
stars if I had to scale them in different sizes? That would mean
hundreds of glDrawArrays calls instead of one.
Not the way I'm reading the docs (mind you, my GL is more than a little
rusty - last time I worked with 3D was more than 10 years ago)....
But it seems like you should be able to draw all quads that use the same
texture in one call, using GL_TRIANGLES or GL_QUADS (not _STRIP or _FAN,
because those are always joined). This can product transparency
artifacts depending on their z-order, so you'd need to sort the quads
according to their texture and z-order both.
Or just forgo the mipmapping for initial tests, then there's be one less
thing to worry about with respect to sorting.
A point sprite is a screen-aligned element of variable size that is
defined by a single point. Would it really be a sprite if it was
mapped to a quad polygon?
If it looks like a sprite, and quacks like a sprite...
--
Kostya Vasilyev