Hi!
This might not be considered a "pure" NGUI-question but in case it's because of how UITexture works, I ask here anyways...

Basically, I want to "print" a Texture2D (UITexture.mainTexture), but not the raw, default texture, but the texture AFTER the shading has been applied (like alpha, texture-flip etc., everything that get's applied in a shader). I seriously have no clue at all how to go about this: Accessing the texture from the material (tested without success)?...
Any thoughts? Thanks!
Edit. Or is it just so easy that I wait for end of frame using a coroutine?
yield return new WaitForEndOfFrame
();
Edit2. Nope.
Edit3. To have a fallback-solution I read (which I knew would work, but want to avoid) the pixels directly from screen like this:
int previousDepth = depth;
depth = int.MaxValue;
yield return new WaitForEndOfFrame
();
tex
.ReadPixels(new Rect
(0,
0, tex
.width, tex
.height),
0,
0); tex.Apply();
depth = previousDepth;
yield return new WaitForEndOfFrame
(); //<-- symbolic to be in correct state when "done"
Problem with this is that:
1. It flickers (barely noticeable though) and
2. It's more of a hack (I hate hacks).
3. It relies on the texture being at front.
4. It's just hard to maintain.