Esempio n. 1
0
        public static RenderTargetSet GetRenderTargetHistory(string name, int framesBefore = 1)
        {
            TemporalRenderTargetSetDescriptor set = m_TemporalRenderTargets[name];
            int phaseHistory = set.m_Phase - framesBefore;

            if (phaseHistory < 0)
            {
                phaseHistory = set.m_RenderTargets.Length + phaseHistory;
            }

            return(set.m_RenderTargets[phaseHistory]);
        }
        public static void InitializeRenderTarget( string name, RenderTargetSet.RenderTargetDescriptor descriptor, int countHistory = 1)
        {
            if (m_TemporalRenderTargets.ContainsKey(name))
            {
                throw new Exception("Temporal surface with given name already exists");
            }

            List<RenderTargetSet> sets = new List<RenderTargetSet>();

            while (countHistory-- >= 0)
            {
                sets.Add(RenderTargetManager.RequestRenderTargetFromPool(descriptor));
            }
            TemporalRenderTargetSetDescriptor set = new TemporalRenderTargetSetDescriptor(sets);
            m_TemporalRenderTargets[name] = set;
        }
Esempio n. 3
0
        public static void InitializeRenderTarget(string name, RenderTargetSet.RenderTargetDescriptor descriptor, int countHistory = 1)
        {
            if (m_TemporalRenderTargets.ContainsKey(name))
            {
                throw new Exception("Temporal surface with given name already exists");
            }

            List <RenderTargetSet> sets = new List <RenderTargetSet>();

            while (countHistory-- >= 0)
            {
                sets.Add(RenderTargetManager.RequestRenderTargetFromPool(descriptor));
            }
            TemporalRenderTargetSetDescriptor set = new TemporalRenderTargetSetDescriptor(sets);

            m_TemporalRenderTargets[name] = set;
        }
Esempio n. 4
0
        public static int GetCurrentPhase(string name)
        {
            TemporalRenderTargetSetDescriptor set = m_TemporalRenderTargets[name];

            return(set.m_Phase);
        }
Esempio n. 5
0
        public static RenderTargetSet GetRenderTargetCurrent(string name)
        {
            TemporalRenderTargetSetDescriptor set = m_TemporalRenderTargets[name];

            return(set.m_RenderTargets[set.m_Phase]);
        }