且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在OpenGL ES 1.1中快速绘制许多纹理化的粒子

更新时间:2023-11-09 13:53:22

随机提示.可能会或可能不会运作良好.使用一个绘制调用,或至少将批处理粒子一起分成组(例如,每组32个).您可以在CPU上每帧构造每个组,然后向下发送.只需使用GL_TRIANGLE_FAN构建一个大数组(通过添加相同的顶点两次,使您成为终止"风扇).

Random idea. May or may not work well. Use one draw call, or at least batch particles together into groups (say, 32 per group). You can construct every group per frame on the CPU and then send it down. Just construct one big array with GL_TRIANGLE_FAN (IIRC you an "terminate" fan by adding the same vertex twice).

我认为,挑战之一是创建此缓冲区.这是Java还是JNI?您是否正在使用java.nio缓冲区?根据我在论坛上阅读的内容,在Java中修改这些缓冲区的速度可能非常慢. (顺便说一句-我对Android上的内部缓冲区处理不太熟悉,您可能需要也可能不需要对它们进行双重缓冲.)

One of the challenges, I believe, is to create this buffer. Is this Java or JNI? Are you using a java.nio buffer? From what I read in the forums, modifying those buffers in Java can be terribly slow. (Btw - I'm not that familiar with the internal buffer handling on Android, you may or may not need to double-buffer them.)