Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: quitebuttery on August 25, 2012, 10:58:33 PM
-
I think a killer feature for NGUI (especially in the face of the upcoming Unity 4 GUI) is making widgets more geometry and shader based so we don't need an atlas.
For instance, instead of making a rounded button as an atlas sprite that has alpha on rounded corners, I'd rather have the rounded corners be actual geometry. And perhaps have an inner rounded rectangle and then an outline around it both made out of geometry so I could pick two different shader settings on each part to color the outline and the inside part with shaders instead of textures.
Atlas textures are a pain because they are HUGE--compressing them makes them look terrible, and retina iPad resolutions are blowing up application sizes. I think with creative use of geometry and shaders, you could get away with really small atlases. Maybe just for icons and a few other things--but especially if we can use dynamic fonts and geometry/shader based widgets--we can have tiny atlas sizes on even retina iPad.
At the very least, it would be cool if we could create our own widget geometry and have the widget maker use that when creating widgets instead of the default boxes.
-
That's an interesting idea. But, the way this is usually handled for 2D interfaces is to use vector graphics (e.g. Flash, XAML, SVG, etc.). The markup can be rasterized to a texture/atlas at runtime for the target display resolution. You can interop with NGUI by pointing UITexture / UIAtlas to the output of an SVG rasterizer like this one:
http://wiki.unity3d.com/index.php?title=SVG
-
That's another way to do it, yeah. I figured since fill rate seems to be more of a problem on many devices than geometry, rendering the GUI as geometry (especially if it's just a set of simple boxes instead of rounded edges) might be fast enough to render every frame.
But, baking it out to a texture at load time is a great idea as well. I'm basically trying to solve two problems with this:
* Having HUGE texture atlases blowing up my IPA size.
* Having to juggle new atlases for 4-5 different resolutions. (And who knows how many on Android)
Whether it's dynamic every frame, or baked out at runtime--it solves both of these issues.