public static EffectData FromFile(string fileName) { EffectData data = new EffectData(); data.fileName = fileName; data.dxEffect = ResourceCache.Instance.GetDxEffect(fileName); return data; }
public void Dispose() { this.environment = null; this.explosions.Clear(); this.device = null; this.currentEffect = null; this.asteroids.Clear(); //this. }
public void SetEffect(string effectName) { if (currentEffect == null || currentEffect.FileName != effectName) { EffectData effect = ResourceCache.Instance.GetEffect(effectName); if (effect.ParamHandles == null) { effect.ParamHandles = this.ShaderConstants.GetParameters(effect.DxEffect); } this.ShaderConstants.SetEffectParameters(effect.DxEffect, effect.ParamHandles); currentEffect = effect; } else { this.ShaderConstants.SetEffectParameters(currentEffect.DxEffect, currentEffect.ParamHandles); } }
public void SetEffect(EffectData effect) { if (currentEffect != effect) { if (effect.ParamHandles == null) { effect.ParamHandles = this.ShaderConstants.GetParameters(effect.DxEffect); } this.ShaderConstants.SetEffectParameters(effect.DxEffect, effect.ParamHandles); currentEffect = effect; } else { this.ShaderConstants.SetEffectParameters(effect.DxEffect, effect.ParamHandles); } }
public void SetParameters(EffectData effect) { SetEffectParameters(effect.DxEffect, effect.ParamHandles); }