Hi everyone:
I’m working on an app that draws a lot of lines rather than using textures (like Asteroids or Battle Zone), and I’m trying to figure out two things:
- How to make some of the lines semi-transparent.
- How to control anti-aliasing.
Here’s how I’m drawing my lines:
GraphicsDevice gd = ...;
using (var be = new BasicEffect(gd))
{
be.VertexColorEnabled = true;
Matrix mat;
Matrix.CreateOrthographicOffCenter(0, w, h, 0, 0, 1, out mat);
be.Projection = mat;
foreach (EffectPass pass in be.CurrentTechnique.Passes)
{
pass.Apply();
gd.DrawUserIndexedPrimitives(
PrimitiveType.LineList,
Vertices.ToArray(), 0, Vertices.Count,
Indices.ToArray(), 0, NLines);
}
}
Right now alpha is being ignored. And for AA I’ve done “PreferMultiSampling = true” but it looks terrible. I don’t know how to specify 4x, or if there’s some other method I can use.
Thanks in advance!
Mike