/// <summary> /// Update distortion fields for next render /// </summary> /// <param name="camera"></param> public static void Update() { if (EnabledSM2 || EnabledSM3) { if (EnabledSM3) { if (distFilter == null) { distFilter = new DistortFilter("DistortFilter"); BokuGame.Load(distFilter); } distFilter.Update(); bumpScroll += Time.GameTimeFrameSeconds * bumpRate; bumpScroll = MyMath.Wrap(bumpScroll); } for (int index = lies.Count - 1; index >= 0; --index) { Distortion lie = lies[index]; if (!lie.Bloom && !EnabledSM3) { lies.RemoveAt(index); lie.Release(); } else if (!lie.Update()) { lies.RemoveAt(index); lie.Release(); } } } }
public static void UnloadContent() { BokuGame.Release(ref bump); BokuGame.Release(ref partyEffect); effectCache.UnLoad(); if (distFilter != null) { distFilter.UnloadContent(); distFilter = null; } Distortion.UnloadContent(); }
public static void LoadContent(bool immediate) { if (EnabledSM2 || EnabledSM3) { if (bump == null) { bump = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\DistortionWake"); } if (partyEffect == null) { partyEffect = BokuGame.Load <Effect>(BokuGame.Settings.MediaPath + @"Shaders\Particle2D"); effectCache.Load(PartyEffect, ""); } if (distFilter == null) { distFilter = new DistortFilter("DistortFilter"); } distFilter.LoadContent(immediate); } Distortion.LoadContent(immediate); }