Sign in to follow this  
ultim

no point sprites from VB

Recommended Posts

When I render point sprites from a vertex buffer, only one single sprite gets drawn. However, if I use almost the same code to render from an array (a user pointer), everything is fine. I'm using managed directx. Here's the code: verts = new CustomVertex.PositionColoredTextured[numNewParticles]; ...fill verts array with data... VB.SetData(verts, 0, LockFlags.Discard); // this works fine Device.SetStreamSource(0, VB, 0); Device.DrawUserPrimitives(PrimitiveType.PointList, numNewParticles, verts); // this only renders one particle Device.DrawPrimitives(PrimitiveType.PointList, 0, numNewParticles); What can possibly be the problem? Thanks for your help in advance

Share this post


Link to post
Share on other sites
update:

// this works fine
Device.DrawUserPrimitives(PrimitiveType.PointList, numNewParticles, verts);

// this only renders one particle
Device.SetStreamSource(0, VB, 0);
Device.DrawPrimitives(PrimitiveType.PointList, 0, numNewParticles);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this