Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: ArenMook on May 16, 2012, 09:14:21 PM
-
Explanation of the feature added in 2.0.6 -- the ability to use channel-packed fonts.
http://www.youtube.com/watch?v=dY6jQ7d2ius
-
That was an awesome tutorial thanks. Seems kind of ironic that I finally get my Japanese font working and then you release an update. 8)
It is a shame there are some limitations though, I noticed in the window (or maybe it was just youtube) that the fonts probably don't contain their aliasing, in other words they will look pixelated.
I don't think we care about alpha or adding the font to an atlas (that means I guess an extra draw call) but I think the shadow outlines and clarity of the font is vital, since we need to have different sized texts and I suspect without the aliasing they would probably go quite distorted.
However, an awesome feature that I will certainly look into later.
-
No pixelation there. The fonts look exactly the same.
-
That's what I thought, I just couldn't tell. Time to have a test and see what happens.
-
I think this feature is awesome. However, could you educate me on why the vertex color alpha blending won't work with the shader? From my level of understanding couldn't you use the vertex color alpha information to multiply into the final fragment color?
-
Alpha channel of vertex colors is used to pass information regarding which channel (red, green, blue or alpha) should be used.
-
Feature Request: Since it already is a separate shader, could you send the specific color data using a second set of UV coordinates instead of the alpha component of the vertex color? Maybe make it an option if users want a shader that is faster. I just think it's a shame to lose some functionality there especially since another draw call is required.
-
In order to do that I'd have to add extensive modifications to NGUI that will first make it use the secondary UV coordinates, as UV2s aren't currently involved in the UI creation process. On top of that, UV2s won't even be used in 99% of the UIs, making this feature simply cost resources in most cases -- and that's something I would rather avoid. One other issue is that UV2s are 2 values, (X and Y), and I need to pass at least 3 to the shader, as there are 4 channels.
-
I'm sorry to beat a dead horse (such an awful expression). I just was thinking about this, and trying to think of a solution. If transparency is desired could there be an option to maybe make the vertex color space to be 7-bit instead of 8-bit allowing you to use one bit of each color channel to represent which channel the character is located in? I figure this would allow us to keep transparency while keeping a very close representation of the vertex color. Maybe something to consider for a future upgrade. Thanks for your time.
-
There is no concept of bits within a shader. :P All you get is a 0-1 value to work with.
-
So as I was explaining to you via Skype why it wouldn't work, I had an idea that I followed up on... lo and behold, the packed fonts will no longer tie up the alpha channel with the next update (pro version users already have access to the change, of course).
-
Isn't the packed font feature working with iOS devices? This feature is really awesome with eastern language characters to reduce the size of font textures, and it really is very useful when it is used on mobile devices like iOS. I tried on my iPhone 4S and iPad 3rd Gen. and I couldn't see correct font displayed.
-
I think that's because I used "fixed4" data type in the shader. Change all "fixed" to "half" and it should work. I've made that change in the repository, so it will also be fixed in the next update.
-
Thank you for your quick reply and your support. I edited and it works perfectly!