Author Topic: UITexture slow performance  (Read 6675 times)

Madgeniy

  • Guest
UITexture slow performance
« on: February 14, 2013, 03:11:47 AM »
Hello. I want to use UITexture script for background texture with enbaled 2x MSAA, but if I use it, I have 18 FPS on iPad1. If I use simple plane object with texture on it, I have 60 FPS. What is wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture slow performance
« Reply #1 on: February 14, 2013, 01:59:49 PM »
The difference is in a shader you're using, I'm guessing. Unlit/Transparent Colored is a slow shader. Use Unlit/Texture instead.

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #2 on: February 15, 2013, 01:29:12 AM »
I use Unlit/Texture shader. It is problem of UIWidget, I think is gles1.1 mode only with turned on MSAA.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture slow performance
« Reply #3 on: February 15, 2013, 02:41:41 PM »
The widget simply generates geometry for you, so no, unless you are changing the widget's position or something every frame, there won't be any effect on performance at all. Certainly not 60 -> 18 FPS.

Also keep in mind, MSAA is very slow on mobile devices.

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #4 on: February 16, 2013, 03:23:27 AM »
So, I generated a simple plane with 2 triangles and 1 texture on it, and I have 60 FPS, if I use UITexture with the same texture, I have 18 FPS. It's very strange for me.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture slow performance
« Reply #5 on: February 16, 2013, 01:45:46 PM »
When in doubt, profile it.

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #6 on: February 17, 2013, 06:30:22 AM »
When I use profiler, it says, than Device.Present take a lot of time on iPad1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture slow performance
« Reply #7 on: February 17, 2013, 07:12:21 PM »
That's drawing -- so once again, back to the shader.

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #8 on: February 18, 2013, 03:48:14 AM »
Shader is very simple - Unlit/Tetxure.


Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #9 on: February 20, 2013, 03:56:40 AM »
ArenMook, please, clear the situation. I replaced all possible widgets with simple planes with textures and my FPS was increased. So, I think, there are still problems with UIPanel and UIWIdget scripts. If you can debug it, please do it, because it causes big performance issues.
« Last Edit: February 20, 2013, 03:58:39 AM by Madgeniy »

Sokharev

  • Guest
Re: UITexture slow performance
« Reply #10 on: February 20, 2013, 04:45:38 AM »
Hello Madgeniy,
What is your texture size & texture settings(compression/etc) & texture coordinates & shader ? is it identical for plane+texture & ngui render?
Your plane + texture mapped exactly as ngui to screen?

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #11 on: February 20, 2013, 04:58:50 AM »
Hello, my texture is 1024*768, texture settings import - GUI, texture coordinates for simple texture - standart (0,0; 0,1; 1,0; 1,1) it is identical for plane+texture and ngui render, and exactly mapped to ngui screen.

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #12 on: February 20, 2013, 05:06:28 AM »
It seems to me, that every widget takes more and more FPS in gles1.1 with antialiasing mode, it's not the same for gles2.0 without antialiasing mode. My previous GUI was standart UNITY's GUI, but it generates many drawcalls. Now I haven't many draw calls, but now I have problem only in gles1.1 antialiasing mode on iPad1.

Sokharev

  • Guest
Re: UITexture slow performance
« Reply #13 on: February 20, 2013, 06:06:52 AM »
Madgeniy,
Every new widget can drop fps if you don't hide previous one. But if amout of pixels drawed physically the same(and "quality" of pixels : shader heaviness/texture distortion & bits per pixel ) - fps MUST be equal. Profiler showing "Present" - it means that you're seating in fillrate. for example redrawing 2 textures at once.or you enabled alphatest/alphablend - it's very heavy ops( did you mention that shader the same? )

Madgeniy

  • Guest
Re: UITexture slow performance
« Reply #14 on: February 21, 2013, 03:13:01 AM »
So, I created a simple scene with NGUI UI, added one simple texture with UITexture and my FPS drop down to 30 instead of 60 on iPad1 with enabled gles1.1 with antialising. I have no ideas what wrong. If anybody can help me, please, create simple scene with one texture 1024*768 (GUI+bilinear import settings, shader - Unlit/texture) with UITexture script and compare simple texture FPS with FPS on simple plane (2 traingles) and texture on it. Project settings:
disable shadows
pixel light count 2
texture quality full res
anisotropic textures per texture
anti aliasing 2x
blend weights 1bone
vsync count don't sync (it's not actual on iOS)
Thanks