Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - neilb

Pages: [1]
1
NGUI 3 Support / Shaders not working on Tegra devices
« on: October 17, 2014, 10:47:50 PM »
I've just released a new app using the latest NGUI and I've been getting reports from users that none of the UI graphics are appearing.

The problem seems to be the Unlit/Transparent Colored shader. I tried changing to a different shader (that doesn't handle the border and padding correctly) and some of the UI elements showed up.

Bitmap font based text is also affected, but only when it appears to be in front of an Unlit/Transparent Colored UI element. Free floating UI Labels that are behind everything in the background are being rendered.

I was able to reproduce the problem on a Ouya console (Tegra 3), but it works fine on any other non-Tegra device.

There are no messages in the log reporting errors of any kind.

I'm still investigating, but it appears to be the shader. Any ideas?

Edit: I've now had reports of the same problem on Tegra2, 3 and 4 devices

Edit: After spending a lot of time on this, I narrowed it down. It's caused by selecting orthographic rendering with a large far value for the clipping plane. This causes only the most distant GUI objects to render, everything else vanishes. If the camera is switched to perspective, or the far value is reduced, everything will be rendered.

2
I am using a single scroll view. Rather than creating a dozen pages of identical buttons, my code is using one page and moving it around off-screen to give the illusion of multiple pages.

I have a workaround. This is just a report that the something has broken in the last month or so.

3
I've just updated to latest NGUI 3.0.8 f7 from an earlier version of 3 running on Unity 4.3.1 f1 on a Mac.

I have an object with a UIPanel + UIScrollView that covers the screen and contains a UIGrid showing an array of buttons representing levels. The user can switch pages by dragging the buttons left or right, after which the panel will slide out of view, swap to the other side of the screen, then slide back into view, simulating multiple pages.

This is the process:
SpringPanel.Begin to move the panel offscreen
transform.localPosition to swap it to the other side of the screen while hidden
SpringPanel.Begin to move it back into view

The problem is that the purple clipping rectangle will be left behind after the call to transform.localPosition and no longer line up with the panel when it reaches it's final location at the center of the screen. It'll be about one panel width to the left or right of where it should be and it doesn't move with the second call to SpringPanel like it did with the first call. This means the buttons won't respond to clicks anymore.

If I set clipping to None on the UIPanel after the app starts (clipping auto-activates at run time), the buttons will continue to work after the panel has moved. This is how I've worked around the problem for now.

4
I've noticed that if a label has the following properties:
  • a vertical center pivot point
  • overflow set to resize content
  • one line of text
  • a font with a negative vertical spacing (to pack lines together)
then the label text will be offset towards the bottom of the label container.

Changing the vertical pivot to top will move the text back to the approximate vertical center of the label.

To demonstrate the problem with the way it's being handled now: a label placed approximately in the vertical center of a button, with a top pivot, will appear to be offset towards the top of the box when showing longer strings. If it's given a vertical center pivot, then it will be offset towards the bottom of the button for longer strings. A vertical bottom pivot will put the text outside the boundary of the label.

NGUI 2 behaviour with a single line of text was to vertically center align it, if the pivot was centered.

Thanks

Pages: [1]