public virtual void Render(ITextureCache cache) { if (Updated) { return; } Updated = true; foreach (var filter in InputFilters) { filter.Render(cache); } var inputTextures = InputFilters.Select(f => f.OutputTexture); OutputTexture = cache.GetTexture(OutputSize); Render(inputTextures); foreach (var filter in InputFilters) { if (filter.LastDependentIndex <= FilterIndex) { filter.Reset(cache); } } }
public void Render() { if (Updated) { return; } Updated = true; foreach (var filter in InputFilters) { filter.Render(); } var inputTextures = InputFilters .Select(f => f.OutputTexture) .ToList(); OutputTarget = TexturePool.GetTexture(OutputSize, OutputFormat); Render(inputTextures); foreach (var filter in InputFilters) { if (filter.LastDependentIndex <= FilterIndex) { filter.Reset(); } } }
public void Render() { if (m_Updated) { return; } m_Updated = true; m_Output = Output; foreach (var filter in InputFilters) { filter.Render(); } var inputs = InputFilters .Select(f => f.Output) .ToList(); Output.Allocate(); Render(inputs); foreach (var filter in InputFilters.Where(filter => filter.LastDependentIndex <= m_FilterIndex)) { filter.Reset(); } }
public IFilter <TOutput> Compile() { if (m_CompilationResult != null) { return(m_CompilationResult); } m_OriginalInputFilters = InputFilters; InputFilters = InputFilters .Select(x => x.Compile()) .ToArray(); m_CompilationResult = Optimize(); return(m_CompilationResult); }
protected Filter(TOutput output, params IFilter <TInput>[] inputFilters) { if (inputFilters == null || inputFilters.Any(f => f == null)) { throw new ArgumentNullException("inputFilters"); } m_Initialized = false; m_CompilationResult = null; m_InputFilters = inputFilters; m_Output = output; m_ProcessData = new ProcessData(); ProcessData.AddInputs(InputFilters.Select(f => f.ProcessData)); }