Skip to main content
Post Undeleted by Blau
added 24 characters in body
Source Link
Blau
  • 3.4k
  • 18
  • 19

usually to drawDon't use DrawUserIndexedPrimitive... create an individual vertexbuffer for your moving objects.. or group all your moving objects in a model you needvertex buffer to setup its vertexbuffer, its indexbuffer and its effectshare it...

So the firstin your object draw will need a setup... and the second call another setup... that replaces the vertex buffer, the index bufferyou can set an individual indexbuffer and transform the effect, but not destroy them,position passing the continue living in gpu memory.world matrix to the effect

usually to draw a model you need to setup its vertexbuffer, its indexbuffer and its effect.

So the first draw will need a setup... and the second call another setup... that replaces the vertex buffer, the index buffer and the effect, but not destroy them, the continue living in gpu memory.

Don't use DrawUserIndexedPrimitive... create an individual vertexbuffer for your moving objects.. or group all your moving objects in a vertex buffer to share it...

in your object draw call, you can set an individual indexbuffer and transform the position passing the world matrix to the effect

Post Deleted by Blau
Post Undeleted by Blau
Post Deleted by Blau
Source Link
Blau
  • 3.4k
  • 18
  • 19

usually to draw a model you need to setup its vertexbuffer, its indexbuffer and its effect.

So the first draw will need a setup... and the second call another setup... that replaces the vertex buffer, the index buffer and the effect, but not destroy them, the continue living in gpu memory.