public static Graph Downsample(Graph graph, PowOf2 pot = PowOf2._2) { Shader downsampling16 = Shader.Find("Hidden/TextureFlow/Downsampling16X"); Graph newGraph; int di = (int)pot; for (; di > 2; di >>= 2) { newGraph = new Graph() { _shader = downsampling16, _downsample = 4, }; ((Property)graph).Apply(newGraph); new Vec("_PixelOffset", 1, 1, true).Apply(newGraph); graph = newGraph; } if (di == 2) { newGraph = new Graph() { _downsample = 2, }; ((Property)graph).Apply(newGraph); graph = newGraph; } return(graph); }
public Graph Downsample(PowOf2 pot = PowOf2._2) { return(Graph.Downsample(this, pot)); }