Author Topic: [Solved] Nintendo Switch specific bug with Texture mask on UI Panel  (Read 3039 times)

dadrester

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Hi,

We're doing a switch version of Vostok Inc. (http://www.eurogamer.net/articles/2017-07-25-vostok-inc-review) and we have a strange bug that only occurs on the Switch version.

As part of our tutorial flow we have a UI Panel with a circular texture mask that 'cuts out' a hole in a semi transparent black UI sprite and tweens to show the player specific points of interest. On all other platforms and in the editor it appears correct, however on Switch hardware there appears to be an issue with it. I've pasted some images of how it should look and how it looks.

Any ideas on what might be wrong and how we can fix it?

« Last Edit: October 09, 2017, 05:08:07 AM by dadrester »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Nintendo Switch specific bug with Texture mask on UI Panel
« Reply #1 on: October 07, 2017, 06:16:26 AM »
Look for the Unlit - Transparent Colored (TextureClip) shader. That's the shader that is used when you specify a clipping texture on the panel. Something Nintendo doesn't like about it -- I'd suggest playing with it.

dadrester

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Nintendo Switch specific bug with Texture mask on UI Panel (solved)
« Reply #2 on: October 09, 2017, 05:07:46 AM »
We managed to fix it Friday. Coder has this in the changelist if anyone else has a similar problem:

Fixed focus hole alpha sampling problem in shader for switch.
I am not entirely sure whether it is SwitchSDK for Unity problem or NGUI but the problem seems to be on
the alpha value that gets sampled using clipUV on _ClipTex. The solution I have proposed is to manually limit
sampling range for alpha value between 0 and 1 on both u and v texture coordinates. This is because original alpha
sampling returns correct value on the centre but incorrect from the edge pixel.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Solved] Nintendo Switch specific bug with Texture mask on UI Panel
« Reply #3 on: October 09, 2017, 09:48:43 AM »
Is your mask texture not set to Clamp?

dadrester

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: [Solved] Nintendo Switch specific bug with Texture mask on UI Panel
« Reply #4 on: October 13, 2017, 05:42:29 AM »
Yep, clamped, if it was set to repeat it would tile over the screen with this setup. We think it was a shader problem. Anyhoo, fixed now.