Пример #1
0
        void OnPostRender()
        {
            PixelPerfectRendering.pixelSnapSpacing = 0.0f;

            // Clear the screen to black so that we can see black bars.
            // If a temporary offscreen RT is used, we do the clear after we're done with that RT to avoid an unnecessary RT switch.
            if (m_Camera.activeTexture != null)
            {
                Graphics.SetRenderTarget(null as RenderTexture);
                GL.Viewport(new Rect(0.0f, 0.0f, Screen.width, Screen.height));
                // <edit>
                GL.Clear(false, true, m_FillColor);
                // </edit>
            }

            if (!m_Internal.useOffscreenRT)
            {
                return;
            }

            RenderTexture activeRT = m_Camera.activeTexture;

            if (activeRT != null)
            {
                activeRT.filterMode = m_Internal.useStretchFill ? FilterMode.Bilinear : FilterMode.Point;
            }

            m_Camera.pixelRect = m_Internal.CalculatePostRenderPixelRect(m_Camera.aspect, Screen.width, Screen.height);
        }
Пример #2
0
        private void OnPostRender()
        {
            Experimental.U2D.PixelPerfectRendering.pixelSnapSpacing = 0.0f;

            if (!m_Internal.useOffscreenRT)
            {
                return;
            }

            RenderTexture activeRT = m_Camera.activeTexture;

            if (activeRT != null)
            {
                activeRT.filterMode = m_Internal.useStretchFill ? FilterMode.Bilinear : FilterMode.Point;
            }

            m_Camera.pixelRect = m_Internal.CalculatePostRenderPixelRect(m_Camera.aspect, Screen.width, Screen.height);
        }