Ejemplo n.º 1
0
    /// <summary>
    /// Pushes a Texture to the Render Queue.
    /// </summary>
    /// <param name="tex">Texture to be pushed to the Render Queue</param>
    /// <param name="width">Texture width</param>
    /// <param name="height">Texture height</param>
    /// <param name="depth">Texture depth (0, 16 or 24), Default 0</param>
    /// <returns></returns>
    private RenderTexture PushRenderQueue(Texture tex, int width, int height, int depth = 0)
    {
        RenderTexture rt = WQ.Count > 0 ? WQ.Dequeue() : new RenderTexture(width, height, depth);

        if (!rt.IsCreated())
        {
            rt.Create();
        }
        Graphics.CopyTexture(tex, rt);
        RQ.Enqueue(rt);
        return(rt);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Pop the Render Queue a given number of times
    /// </summary>
    /// <param name="npops">The number of times to pop the render queue. 0 = Peek.</param>
    /// <returns>The last RenderTexture popped from the Render Queue.</returns>
    private RenderTexture PopRenderQueue(int npops)
    {
        RenderTexture rt = RQ.Peek();

        for (int i = 0; i < npops; i++)
        {
            WQ.Enqueue(rt = RQ.Dequeue());
            if (RQ.Count == Delay)
            {
                if (Delay == 0)
                {
                    passingThrough = false;
                }
                break;
            }
        }
        return(rt);
    }