Esempio n. 1
0
        /// <summary>
        /// Tests if a sub frame should be skipped before trying to record it. Callback is invoked for every frame during the recording session.
        /// </summary>
        /// <remarks>
        /// If this function returns True, RecordFrame will not be invoked.
        /// </remarks>
        /// <param name="ctx">The current recording session.</param>
        /// <returns>True if the sub frame should be skipped, False otherwise.</returns>
        protected internal virtual bool SkipSubFrame(RecordingSession ctx)
        {
            if (!settings.IsAccumulationSupported())
            {
                return(false);
            }
            IAccumulation accumulation = settings as IAccumulation;

            AccumulationSettings accumulationSettings = null;

            if (accumulation != null)
            {
                accumulationSettings = accumulation.GetAccumulationSettings();
            }

            int accumulationSamples = 1;

            if (accumulationSettings != null && accumulationSettings.CaptureAccumulation)
            {
                accumulationSamples = accumulationSettings.Samples;
            }

            bool skip = (ctx.subFrameIndex) % accumulationSamples != 0;

            return(skip);
        }
Esempio n. 2
0
        /// <summary>
        /// Are we currently capturing SubFrames.
        /// </summary>
        /// <returns>bool</returns>
        internal static bool CaptureAccumulation(RecorderSettings settings)
        {
#if HDRP_ACCUM_API
            var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
            if (hdPipeline != null && settings.IsAccumulationSupported())
            {
                IAccumulation accumulation = settings as IAccumulation;
                if (accumulation != null)
                {
                    AccumulationSettings aSettings = accumulation.GetAccumulationSettings();
                    if (aSettings != null)
                    {
                        return(aSettings.CaptureAccumulation);
                    }
                }
            }
#endif
            return(false);
        }