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 - sstublic

Pages: [1] 2
1
NGUI 3 Support / Re: Unlit/Transparent Colored problems
« on: January 19, 2015, 05:01:01 PM »
I'm resurrecting this old thread because the above problem persists.

I was hoping new versions of Unity/NGUI would somehow resolve it, but they didn't.

I've found out which part of the shader code (by method of elimination) is causing the problem: 'Offset -1, -1'
This line is not present in Sprites/Default Unity shader and if removed from Unlit/Transparent Colored, the problem resolves.
So to recap:

* On Huawei Mediapad 7 Lite Unlit/Transparent Colored isn't rendering anything, I just get blank camera fill
* If I remove 'Offset -1, -1' from the shader code, everything works perfectly

1. Do you have any idea why this line would be a problem for some devices?

2. Am I safe to go without it? I see no changes in my UI, should I expect any problems if I remove this line?

Thanks!

2
NGUI 3 Support / Re: Need advice on draw call dilemma
« on: January 19, 2015, 09:23:56 AM »
Thanks Nicki!

I already had a similar setup. It's a puzzle game and the board can be 5x5 = 25 elements. Player can touch any/many of those and cause a tween. They were all grouped together in one panel.

Since my post I tried separating them so that each is a panel. I've read that 40 drawcalls should be fine with mobile devices.
I'm doing some testing to decide if I'm gonna leave it that way. So far performance seems slightly better than before.

Cheers!


3
NGUI 3 Support / Greyscale shader
« on: January 18, 2015, 10:59:13 AM »
Hi!

Attached you can find slightly modified Unlit - Transparent Colored shader. It has additional parameter which determines how grey the render will be. 0 is full colored, 1 is completely greyscale. I needed this in my project and couldn't find it.

Disclaimer: I'm not good at writing shaders so use with caution. It does work fine for my mobile project.

Regards

4
NGUI 3 Support / Need advice on draw call dilemma
« on: January 17, 2015, 06:41:18 AM »
I have a dilemma and I was hoping either ArenMook or some of the users might help out:

I have a scene with approx. 10 drawcalls and 500 tris.
One of these drawcalls consists of 25 objects (sprites + labels) which often move, resize and tween in relation to one another.

So, is it better to
1. leave it at 10 drawcalls and have this one panel's geometry being constantly rebuilt
OR
2. change these 25 objects to panels and have no geometry rebuilding BUT increase number of drawcalls to 35 ?

The game is targeted at mobiles (both iOS and Android) and I do not care much for low end extreme devices.

Any hints and personal experience is welcome!

Thank you.

5
NGUI 3 Documentation / Re: UILabel
« on: January 17, 2015, 06:30:12 AM »
Since I needed some of the words having different gradient in the same label (as explained above), that approach wouldn't work at all.

I ended up modifying NGUIText.cs and inserting it to call custom function whenever it's determining final color for each letter using its tint and gradient (in my case either top or bottom). Something like:

  1.  public static Color CombineTintAndGradient(Color tint, Color gradient)

This allowed me to write custom logic on how gradients are formed and fixed my problem. It is a hack, but worked.
If anyone runs into similar problems, feel free to msg me for details.

6
NGUI 3 Documentation / Re: UILabel
« on: December 15, 2014, 12:03:08 PM »
Hi!

I have the following problem: I'm using UILabel to display text (which is dynamic, meaning I don't know exact contents at compile time) which is in blue gradient.
However, some of the words in the text need to be able to become orange gradient (as in highlighted).

Basically I could do this by making the gradient light gray to dark gray and then use UILabel color (via color escape codes) to tint that gradient either blue or orange.
HOWEVER, this solution doesn't work for me, because color gradients I'm using CANNOT be reproduced as a combination of gray gradient and tint.

Could you point me in any meaningful direction how to do this either by:
a) extending color coding functionality to allow gradient escape codes (as in for example [RrGgBb, RrGgBb])
b) somehow preprocessing the text myself before hand and then programatically generate 'concatenated' multiple labels, each for the same colored segment

I've been looking at UILabel code and NGUIText code, but I'd like a way to this without modifying your code, or at least without modifying a lot of it.

Could something like this be done via UILabel inheritance? Do you have any other ideas how to do this?

Thanks!


7
NGUI 3 Support / Re: Unlit/Transparent Colored problems
« on: June 26, 2014, 09:53:14 AM »
I'll try playing with shader source to see which part is causing the problems.

If I find anything I'll let you know.

8
NGUI 3 Support / Re: Unlit/Transparent Colored problems
« on: June 25, 2014, 10:08:48 AM »
I am using NGUI 3.6.2

I don't know on how many devices it doesn't work, since I have access to only few of them...It's not an acceptable risk to assume it is only this one.

Since the end result is the same, is it safe to use Sprites/Default for NGUI materials until issue is resolved somehow?

Is there any other info I could provide to you which will enable you to be certain whether it's NGUI or Unity problem?

Maybe interesting info: NGUIs other shaders DO work. For example Unlit/Transparent or Unlit/Premultiplied Colored

p.s. I'm not really into shaders, but looking at the source code of Sprites/Default, it seems like a vertex/fragment shader as well. Why is it a surface shader?

9
NGUI 3 Support / Re: Unlit/Transparent Colored problems
« on: June 25, 2014, 06:53:05 AM »
I saw this being mentioned somewhere and already tried it (if you're referring to 'Force OpenGL ES 2.0' player setting)...

Doesn't help

10
Whats that license? I'm using NGUI 3.6.1 and I'm having the same issue.

I'd say the problem lies elsewhere, some new incompatibilities between latest Unity and NGUI, but its just wild guessing.

I expect NGUI to resolve this.

11
This may be a completely unrelated issue, but you might try it anyway: http://www.tasharen.com/forum/index.php?topic=10087.0

In order to test if you're having the same issue, change the shader on the material for your atlas and try if anything is rendered then.


12
NGUI 3 Support / Unlit/Transparent Colored problems
« on: June 24, 2014, 07:00:54 AM »
I've been having some weird compatibility problems with Unlit/Transparent Colored shader...what happens:

1. On one Huawei tablet device everything works EXCEPT for sprites with above shader...they just show up empty (nothing is rendered)..I've tried other unlit shaders and most seem to work, but for the project I need this one..This specific one device is not a problem, but I have no way of knowing on how many others it won't work. Device is relatively new and uses Android 4.0 +

2. So far I've checked at runtime and shader IS available and Unity reports it as supported

3. Funniest thing is that when I fiddled some more I've found that Sprites/Default shader (Unitys own sprite shader?) works perfectly fine, doing seemingly same things as Unlit/Transparent Colored, but I'd rather use the original NGUI stuff.

Please help on how to fix it and what caused it...


13
NGUI 3 Support / Re: UIInput and order of elements
« on: February 20, 2013, 01:37:01 PM »
Thanks

I do use more widgets from those atlases and mostly this is where complications strike.

I should obviously, among other things, simplify my scene a bit...


14
NGUI 3 Support / Re: UIInput and order of elements
« on: February 20, 2013, 07:19:09 AM »
Sorry, but those still don't address my issues.

As I wrote I already know about different atlases and depth.

I'll try to be more clear

1. If UIInput is using different atlas for font and background, is changing the Z value of background my only option to make text visible? (changing it on label doesn't work)

2. If I have 2 sprites (A and B) at design time set to Z values -2 and -4 respectively; to what value do I set Z of sprite C so that is drawn between them? Do I use transforms position or localPosition? All sprites are from different atlases. (I was having issues with Z = -3, if this is the way it *should* work, I'll look for clearer example of what was the issue)

Thanks


15
NGUI 3 Support / Re: UIInput and order of elements
« on: February 20, 2013, 07:06:01 AM »
Thanks, I'll read those...I hope they'll help

Such is the nature of users... :)

Pages: [1] 2