Esempio n. 1
0
        public static Texture blendTopDown(Texture top, Texture down)
        {
            down.resize(top.width, top.height);
            var  t   = new Texture(top.width, top.height);
            var  pos = 0;
            uint alpha;

            for (var y = 0; y < top.height; y++)
            {
                alpha = (uint)(255 * y / (top.height - 1));
                for (var x = 0; x < top.width; x++)
                {
                    t.pixel[pos] = ColorUtility.transparency(down.pixel[pos], top.pixel[pos], alpha);
                    pos++;
                }
            }
            return(t);
        }
Esempio n. 2
0
 public void setEnvmap(Texture env)
 {
     envmap = env;
     env.resize(256, 256);
 }
Esempio n. 3
0
 public void setEnvmap(Texture env)
 {
     envmap = env;
     env.resize(256, 256);
 }
Esempio n. 4
0
 public static Texture blendTopDown(Texture top, Texture down)
 {
     down.resize(top.width, top.height);
     Texture t = new Texture(top.width, top.height);
     int pos = 0;
     uint alpha;
     for (int y = 0; y < top.height; y++)
     {
         alpha = (uint) (255 * y / (top.height - 1));
         for (int x = 0; x < top.width; x++)
         {
             t.pixel[pos] = ColorUtility.transparency(down.pixel[pos], top.pixel[pos], alpha);
             pos++;
         }
     }
     return t;
 }