开发者

Can I increase performances using glscissor

I'm working on a 2D game for android using OpenGL ES 1.1 and I would like to know if this idea is good/bad/useless.

I have a screen divided in 3 sections, so I used scissors to avoid object overlapping from one view to the other.

I roughly understand the low level implementation of scissor and since my draws take a big part of the computation, I'm looking for ideas to speed it up.

My current idea is as follows:

If I put a glscissor around each object before I draw it, would I increase the speed of my application.

The idea is if开发者_如何学编程 I put a GLScissor, (center+/-sizetexture), then the OpenGL pipeline will have less tests to do (since it can discard 90~99% of the surface thanks to the glscissors.

So to all opengl experts, is this good, bad or will have no impact ? And why?


It shouldn't have any impact, IMHO. I'm not an expert, but my thinking is as follows:

  • Scissor test saves on your GPU's fill rate (the amount of fragments/pixels a hardware can put in the framebuffer per second),
  • if you put a glScissor around each object, the test won't actually cut off anything - the same number of pixels will be rendered, so no fill rate will be saved.

If you want to have your rendering optimized, a good place to start is to make sure you're doing optimal batching and reduce the number of draw calls or complex state switches (texture switches).

Of course the correct approach to optimizations is to try to diagnose why is your rendering slow, so the above is just my guess which may or may not help in your particular situation.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜