如何在OpenGL ES 1.1中优化大型模型的渲染? [英] How can I optimize the rendering of a large model in OpenGL ES 1.1?

查看:255
本文介绍了如何在OpenGL ES 1.1中优化大型模型的渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的3D应用程序中完成了VBO的实现,并且渲染速度提高了大约5-10倍。过去以每秒1-2帧渲染的内容现在以每秒10-11帧的速度呈现。

I just finished implementing VBO's in my 3D app and saw a roughly 5-10x speed increase in rendering. What used to render at 1-2 frames per second now renders at 10-11 frames per second.

我的问题是,我是否可以进一步改进提高渲染速度?三角形条带会有很大的不同吗?当前顶点不在面之间共享,每个面顶点都是唯一但重叠的。

My question is, are there any further improvements I can make to increase rendering speed? Will triangle strips make a big difference? Currently vertices are not being shared between faces, each faces vertices are unique but overlapping.

我的设备利用率为100%,Tiler利用率为100%,渲染器利用率为11%,资源字节数为114819072.这将在CAD模型上渲染912,120个面。

My Device Utilization is 100%, Tiler Utilization is 100%, Renderer Utilization is 11%, and resource bytes is 114819072. This is rendering 912,120 faces on a CAD model.

有任何建议吗?

推荐答案

Tiler利用率为100%表示您的瓶颈大小与发送到GPU的几何体的大小相同。根据我的经验,无论你如何缩小几何尺寸都可以使渲染时间几乎呈线性减少。这些调整步骤过去对我有用:

A Tiler Utilization of 100% indicates that your bottleneck is in the size of the geometry being sent to the GPU. Whatever you can do to shrink the geometry size can lead to an almost linear reduction in rendering time, in my experience. These tuning steps have worked for me in the past:


  • 如果你还没有,你可以看一下使用索引,这可能会通过消除一些冗余顶点来减少几何。 iOS设备中的PowerVR GPU也针对使用索引几何进行了优化。

  • If you're not already, you could look at using indexing, which might cut down on geometry by eliminating some redundant vertices. The PowerVR GPUs in the iOS devices are optimized for using indexed geometry, as well.

尝试使用较小的数据类型作为顶点信息。我发现我可以使用GLshort而不是GLfloat作为我的顶点和法线,而不会在渲染中失去太多精度。这将显着压缩几何体,并在渲染时提高速度。

Try using a smaller data type for your vertex information. I found that I could use GLshort instead of GLfloat for my vertices and normals without losing much precision in the rendering. This will significantly compact your geometry and lead to a nice speed boost in rendering.

Bin类似颜色的顶点并将它们渲染为一组颜色,而不是而不是提供每顶点颜色信息。由于不需要发送所有颜色信息所带来的加速,所需的几次额外绘制调用的开销将大大超过。通过在我的一个较大模型中对颜色进行分级,我看到渲染时间缩短了约18%。

Bin similarly colored vertices and render them as one group at a set color, rather than supplying per-vertex color information. The overhead from the few extra draw calls this requires will be vastly outweighed by the speedup you get from not having to send all that color information. I saw a ~18% reduction in rendering time by binning the colors in one of my larger models.

你已经在使用VBO,所以你已经利用这种优化。

You're already using VBOs, so you've taken advantage of that optimization.

不要在任何时候停止渲染管道。切掉任何读取当前状态的东西,就像所有glGet *调用一样,因为它们真的搞乱了PowerVR GPU的流量。

Don't halt the rendering pipeline at any point. Cut out anything that reads the current state, like all glGet* calls, because they really mess with the flow of the PowerVR GPUs.

您可以做的其他事情会导致更小的性能改进,例如在VBO中使用交错顶点,法线,纹理数据,将数据对齐到4字节边界等等,但上面的那些是我的我发现在调整我自己的OpenGL ES 1.1应用程序时影响最大。

There are other things you can do that will lead to smaller performance improvements, like using interleaved vertex, normal, texture data in your VBOs, aligning your data to 4 byte boundaries, etc., but the ones above are what I've found to have the largest impact in the tuning of my own OpenGL ES 1.1 application.

Best使用Vertex数据的实践适用于iOS的Apple OpenGL ES编程指南部分。

Most of these points are covered well in the "Best Practices for Working with Vertex Data" section of Apple's OpenGL ES Programming Guide for iOS.

这篇关于如何在OpenGL ES 1.1中优化大型模型的渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆