public Fader(GraphicsDevice device, ContentManager content, SpriteBatch spriteBatch, FadeEffect fadeEffect) { this.device = device; this.content = content; this.sb = spriteBatch; this.fadeEffect = fadeEffect; }
public FadeEffect(GraphicsDevice device, ContentManager content) { // Oh so many hard-coded paths... if (device.GraphicsProfile == GraphicsProfile.HiDef) { effect = content.Load <Effect>("FadeHiDef"); palettes = new[] { null, LoadFadePalette(device, @"Palettes\gs1.bin"), LoadFadePalette(device, @"Palettes\gs2.bin"), LoadFadePalette(device, @"Palettes\gs3.bin"), LoadFadePalette(device, @"Palettes\gs4.bin"), LoadFadePalette(device, @"Palettes\blk.bin") }; red = LoadFadePalette(device, @"Palettes\red.bin"); darkred = LoadFadePalette(device, @"Palettes\darkred.bin"); goofyPalettes = new[] { FadeEffect.LoadFadePalette(device, @"Palettes\eight.bin"), FadeEffect.LoadFadePalette(device, @"Palettes\cga.bin"), FadeEffect.LoadFadePalette(device, @"Palettes\ega.bin"), FadeEffect.LoadFadePalette(device, @"Palettes\gb.bin") }; } else { effect = content.Load <Effect>("FadeReach"); // NOTE: These are hand-calibrated to somewhat match palette effect (-AR) // (Could tweak the shader for better match by adding constrast effect. But probably not worth the effort for Reach. -AR) approximationValues = new[] { Color.White.ToVector4(), new Color(250, 240, 250, 50).ToVector4(), // <- alpha channel = desaturate, higher than approximation of palette effect (~10), because it looks better new Color(130, 140, 150, 4).ToVector4(), new Color(100, 100, 100, 0).ToVector4(), new Color(50, 50, 50, 0).ToVector4(), Color.Black.ToVector4() }; } }