Author Topic: Problem: UI2DSprite with mip map enabled on OpenGL ES 2 (iOS)  (Read 1987 times)

zbyhoo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Hi!

I have problem using UI2DSprite on iOS. Sprite has mip-maps enabled and I swap UI2DSprite.sprite2d in runtime with Sprite downloaded from asset bundle. The problem is that the sprite is half size and looks like texture is clamped. It exists only in OpenGL ES 2 with textures swaped in runtime. When using Metal API this problem doesn't exist.

Do you have any idea for fix or workaround?
I cannot disable mip-maps, because I need them.
« Last Edit: June 07, 2016, 07:56:39 AM by zbyhoo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem: UI2DSprite with mip map enabled on OpenGL ES 2 (iOS)
« Reply #1 on: June 06, 2016, 10:10:18 PM »
Check your quality settings and make sure you are using the original texture sizes. If you use half size textures, you won't get expected results.

zbyhoo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Problem: UI2DSprite with mip map enabled on OpenGL ES 2 (iOS)
« Reply #2 on: June 07, 2016, 12:49:42 AM »
Thanks for quick replay!

I already checked it. I have Texture Quality set to Full Res.

The problem is with the same build on different devices. When run on iOS device which can run Metal API, everything is fine. After disabling mip map on texture, also the problem disappears. Problem is with texture with mip map enabled on OpenGL ES 2 API.

To make it clear, even on newest devices, like iPhone 6s Plus, when I force OpenGL 2 API, problem exists. After I change only API to Metal, everything is fine.
« Last Edit: June 07, 2016, 12:56:25 AM by zbyhoo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem: UI2DSprite with mip map enabled on OpenGL ES 2 (iOS)
« Reply #3 on: June 09, 2016, 02:20:33 PM »
Can it be related to max texture size? Maybe you are exceeding the API's max supported texture size in there. I'd say check the atlas size, but you are using Unity's sprites here, so the atlas is generated by Unity as well.