So I was playing around with XNA working on a 3d engine with 2d sprites as characters and objects. After a while I became very unhappy with the way the sprites were being scaled and billboarded so I created a GameSprite class that takes all the information from the texture2D(pngs) and turns it into VertexPositionColor quads on init.
these are drawn with a basic effect, a struct quad, and a quadList.
basicEffect.CurrentTechnique.Passes[0].Apply();
foreach (ColorQuad quad in currentFrame.quadList)
{
graphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(
PrimitiveType.TriangleList,
quad.Vertices,
0,
quad.Vertices.Length,
quad.Indices,
0,
quad.Indices.Length / 3);
}
(frames are different quads chopped up from the original image for animation, like a sprite sheet)
This creates a great 3D recreation of the sprite that can be zoom entirely with no blur.
Each GameSprite has its own basic effect file.
I was wondering if there was a way, maybe during LoadContent, that I could create these vertices and turn them into models for easier drawing and rendering in this 3D world and if this is even a good way to go about this and if I might experience longerterm problems using lots of these GameSprites and their many quads.
Thanks for reading!
SamplerState.PointClamp
? (see this question) – Andrew Russell Jan 13 at 5:55