Example #1
0
        Texture2D GenSDF(List <Texture2D> TexList)
        {
            SDFGenerator     sdfMaker    = new SDFGenerator();
            List <Texture2D> SDFTextures = new List <Texture2D>();

            for (int i = 0; i < TexList.Count; i++)
            {
                Console.WriteLine("SDF进度:" + ((float)(i) / (float)(TexList.Count)).ToString());
                Texture2D sdf = sdfMaker.GenerateSDF8ssedt(TexList[i]);
                SDFTextures.Add(sdf);
            }

            List <Texture2D> BlurTexs = new List <Texture2D>();

            for (int i = 0; i < SDFTextures.Count - 1; i++)
            {
                Console.WriteLine("SDF Blend进度:" + ((float)(i) / (float)(TexList.Count)).ToString());
                Texture2D blurTex = SDFBlend(SDFTextures[i], SDFTextures[i + 1], 400);
                BlurTexs.Add(blurTex);
            }

            Texture2D averageTexture = AverageTexture(BlurTexs);

            return(averageTexture);
        }
Example #2
0
        Texture2D GenSDFSingle(Texture2D Tex)
        {
            SDFGenerator sdfMaker = new SDFGenerator();
            Texture2D    sdf      = sdfMaker.GenerateSDF8ssedt(Tex);

            return(sdf);
        }