开发者

How to avoid drawing triangles that are outside the viewport?

I have a technical question for the experts in here:

I am developing an OpenGL application for iPhone using openGL 1.x . When i render a big item on the device it become obviously slower and that's seem quite normal to me. But i would have expected an increase of framerate when the object is highly zoomed in as the majority of the vertexes are outside the 开发者_JAVA百科viewport's bounds.

I also try with glEnable(GL_SCISSOR_TEST)/glScissor(0,0,320,480) but the result is always the same? This is really driving me crazy!

Why the not shown triangles are always computed(or why the speed remain the same while drawing a smaller portion of the object)? There is a way to avoid this and subsequently increase the framerate?

Thank you in advance. Greetings.

Peppe.


The triangles have to be transformed into screen space (vertex shader), before the GPU can determine if they are visible. Use view frustum culling to test the visibility of chunks of geometry on the CPU.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜