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); }
public void setEnvmap(Texture env) { envmap = env; env.resize(256, 256); }
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; }