[英]Paint a very high resolution textured object (sphere) in OpenGL ES
I'm drawing planets in OpenGL ES, and running into some interesting performance issues. 我在OpenGL ES中绘制行星,并遇到一些有趣的性能问题。 The general question is: how best to render "hugely detailed" textures on a sphere?
一般的问题是:如何最好地在球体上渲染“非常详细”的纹理?
(the sphere is guaranteed; I'm interested in sphere-specific optimizations) (球体有保证;我对球体特定的优化感兴趣)
Base case: 基本情况:
Limitations: 限制:
Problems: 问题:
...at the moment, the only idea I have that sounds viable is: ......目前,我认为唯一可行的想法是:
...but it seems there ought to be an easier way / better options? ......但似乎应该有更简单的方法/更好的选择?
Seems that there are no way to fit such huge textures in memory of mobile GPU, even into the iPad 3 one. 似乎没有办法在移动GPU的内存中安装如此巨大的纹理,甚至进入iPad 3。
So you have to stream texture data. 所以你必须传输纹理数据。 The thing you need is called clipmap (popularized by id software with extended megatexture technology).
你需要的东西叫做clipmap (由扩展的megatexture技术的id软件推广)。
Please read about this here, there are links to docs describing technique: http://en.wikipedia.org/wiki/Clipmap 请在这里阅读,有链接到描述技术的文档: http : //en.wikipedia.org/wiki/Clipmap
This is not easily done in ES, as there is no virtual texture extension (yet). 这在ES中不容易完成,因为还没有虚拟纹理扩展。 You basically need to implement virtual texturing (some ES devices implement ARB_texture_array) and stream in the lowest resolution possible (view-dependent) for your sphere.
您基本上需要实现虚拟纹理(某些ES设备实现ARB_texture_array)并以尽可能低的分辨率(视图相关)为您的球体进行流式传输。 That way, it is possible to do it all in a fragment shader, no geometry subdivision is required.
这样,可以在片段着色器中完成所有操作,不需要几何细分。 See this presentation (and the paper) for details how this can be implemented.
有关如何实施此详细信息,请参阅此演示文稿 (和文章)。
If you do the math, it is simply impossible to stream 1 GB (24,000 x 12,000 pixels x 4 B) in real time. 如果进行数学计算,则无法实时传输1 GB(24,000 x 12,000像素x 4 B)。 And it would be wasteful, too, as the user will never get to see it all at the same time.
这也是浪费,因为用户永远不会同时看到它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.