public static void Render( this SpriteBatch spriteBatch, Effect effect, Texture2D texture, ref Rectangle destinationRectangle, ref Color color) { //spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque); //{ // foreach (EffectPass pass in effect.CurrentTechnique.Passes) // { // pass.Apply(); // spriteBatch.Draw(texture, destinationRectangle, color); // } //} //spriteBatch.End(); var samplerState = texture.ResolveSamplerState(); spriteBatch.Begin( SpriteSortMode.Deferred, BlendState.Opaque, samplerState, null, null, effect); spriteBatch.Draw(texture, destinationRectangle, Color.White); spriteBatch.End(); }