Certain grid lines not rendering as expected
- by row1
I am drawing a simple quad (a triangle strip with 4 vertices) as the floor and then drawing an 8x8 grid over top (a collection of vertex pairs for a line list). The vertical grid lines work fine (apart from being very aliased), but some of the horizontal lines do not get rendered. The grid renders fine if I do not draw the quad.
foreach (EffectPass pass in _Effect.CurrentTechnique.Passes)
{
pass.Apply();
CurrentGraphicsDevice.SetVertexBuffer(_VertexFloorBuffer);
_Engine.CurrentGraphicsDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);
//Some of the horizontal lines seems to disappear if we draw the above quad.
CurrentGraphicsDevice.SetVertexBuffer(_VertexGridBuffer);
CurrentGraphicsDevice.DrawPrimitives(PrimitiveType.LineList, 0, _VertexGridBuffer.VertexCount / 2);
}
What could be causing these lines to not be rendered?
Update:
I added the below code after I draw my quad and grid and it started working. But I am not sure why that works as I thought this code was to draw the WPF controls
elementRenderer.Render();
spriteBatch.Begin();
spriteBatch.Draw(elementRenderer.Texture, Vector2.Zero, Color.White);
spriteBatch.End();