1
\$\begingroup\$

I'm trying to render 3 textures 400 times (first,second,third 400 times). I use vertex shader that takes attribute tex_id; - this is the id of texture to use. In fragment shader i have sampler2D textures[3]; and binding them via setUniformi("textures[0..3],0...3); So i draw all textures in one draw call binding them once. In desktop i have really fast results, but on GLES there is no difference at all. Using 1 draw call with 1 tetures binding, or using 400 drawcalls with 400 textures bindings has same fps. Why? First i think about gles limitations of lower android versions, then try adroid 4.4+ with API18 glSurfaceView20, but nothing changes.

\$\endgroup\$
0
\$\begingroup\$

I think the problem you described is Libgdx Disable Vsync for Android Instead of Desktop . According to it, you could not disable vsync in your mobile device, and you could get same fps if the game performance is fine.

\$\endgroup\$
  • \$\begingroup\$ Game perfomance is not fine in this case. This is a stress test of rendering, its got about 12 fps for 1000 draw calls with 999 texture switching, and 12 fps with 1 draw call and 3 binding of textures at start. Vsync is not the answer here. Looks like android makes textures switchings by itself. \$\endgroup\$ – TripleSky Aug 20 '17 at 6:56
0
\$\begingroup\$

So, there is no perfomance gain on phone, because of low end GPU + more complex fragment shader. if i work with only 2 textures = less "if statements" or readin from sampler2D[] in shader = more fps. Better way is to accurately use your textureAtlases and keep fragment shader for batching as simple as you can.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.