Directx resource usage question.

Started by
1 comment, last by sumit381 17 years, 1 month ago
I am developing a data visualization app using directx. The app basically with get input data from a file and make a 3-D grid with data points. I am currently using sphere objects for the data points; however, soon I will need to handle maybe millions of data points. What is the best way to represent those points, using actual spheres or using sprites? I learned a little about billboarding. Would that render faster as opposed to spheres? Thank you for your help.
Advertisement
millions of points + 3d spheres = billions of faces.

Go with a sprite. Make a 3d model, render it, take a screen shot. Use the screen shot as your sprite image so that they all look like 3d shaded balls.
Thanks for your help. I have tried using sprites before but for some reason the rendering for sprites was so much slower than spheres. Here is the code I used for the sprites:


//d3dDevice.SetTexture(0, null);
myownvertexformat[] spritecoordsarray = new myownvertexformat[dataList.Length];
for (int i = 0; i <= dataList.Length - 1; i++)
{
#region makes data points using 3D spheres
//d3dDevice.Transform.World = Matrix.Translation((float)dataList.X, (float)dataList.Y, (float)dataList.Z);
//dataSphereMesh.DrawSubset(0);
#endregion

#region makes data points using sprites
spritecoordsarray = new myownvertexformat((float)dataList.X, (float)dataList.Y, (float)dataList.Z, 0.5f);
d3dDevice.SetTexture(0, sphereSpriteTexture);
d3dDevice.VertexFormat = VertexFormats.Position | VertexFormats.PointSize | VertexFormats.Diffuse;
d3dDevice.DrawUserPrimitives(PrimitiveType.PointList, dataList.Length, spritecoordsarray);
#endregion
}

The image I am using for the sprite is JPG format approximately 1.7Kb in file size and 40x40 in pixel size. Is there something I am not doing correctly in this? Please help if possible. Thanks.

This topic is closed to new replies.

Advertisement