0

I'm trying to draw a bullet in Monogame with a high velocity. When I draw it for about 400px/sec "Which is quite slow" but around 1500px/sec it starts "duplicating" or "ghosting" the Texture. I am fairly new to Monogame and do not have alot of knowledge on Graphics.

How can I move an object with High Velocity without creating a "ghost" effect ?

SpriteBatch Begin :

 sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, RasterizerState.CullNone,
            null, Global.Camera.GetViewTransformationMatrix());

Draw Method :

public override void Draw(SpriteBatch sb)
{
        Vector2 origin = new Vector2(source.Width / 2, source.Height / 2);
        Rectangle tRect = Bounds;

         sb.Draw(
            texture: TDTGame.GameAssets.Texture,
            destinationRectangle: tRect,
            sourceRectangle: source,
            rotation: MathHelper.ToRadians(Rotation - 270f), //Set rotation to forward of the texture.
            color: Color.White,
            origin: origin,
            layerDepth: 1f
            );
}

Edit:

Youtube Link : here

Movement of the bullet :

    float traveledDistance;
    public override void Update(GameTime gt)
    {
        float deltaTime = (float)gt.ElapsedGameTime.TotalSeconds;
        traveledDistance += Speed * deltaTime;

        Position += Forward * Speed * deltaTime;

        if (traveledDistance > Range)
        {
            Destroy();
        }
    }
Dylan Wijnen
  • 219
  • 3
  • 13
  • are you able to post a screenshot or video of the ghosting? Is it possible that the ghosting is an illusion. – craftworkgames Jul 17 '16 at 02:26
  • @craftworkgames It does feel like an illusion as when I recorded with a lower frame rate you don't see the trail. Also capturing it in a still image "prntscrn" didn't show the trail. Love the MonoGame.Extended library just wanna say keep up the good work ! – Dylan Wijnen Jul 17 '16 at 13:30
  • In that case, maybe play around with the background color and see if you can get rid of it that way or look at other games with fast moving objects and see if they do anything interesting. – craftworkgames Jul 17 '16 at 22:05

2 Answers2

0

This is likely an artifact of low frame rate. The higher the frame rate, the less your brain will register the fact that the bullet's "movement" is simply drawing the same image in multiple and changing locations over time :)

Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
0

As stated the traces are probably in your eyes, not on the screen. If you want to overcome this effect, you may want to skip some frames (maybe completely remove the bullet from screen or at least skip movement).