   [SlimDX] One vertex buffer per "mesh model" ?
  Hi!This is my first post on this forum, so I introduce me. I'm french, so, sorry for my bad english. I am more in graphics than the programming but I learn VB since some years and I'm a beginner in 3D programming (but tried OpenGL/MDX/XNA and now SlimDX).I can easilly setting up a basic scene and drawing small meshes in direct mode. Now I try to use vertex buffers, but I'm not very familiar with this.My project is just a simple viewer for point clouds, so I think I will have only one mesh object at a time. But this project must be a little flexible an showing more than one mesh.Is it best to define only one vertex buffer for all my meshes or one vertex buffer per mesh ?I have many questions and I will fill the forum if I ask them all in separate topics. So, just another small question.For my point cloud viewer, in a first time, I will show only points. but for a good 3D view, I think this points must be shaded by my directional light. I know I must define a normal for each polygon and I know how to do. But is it possible to calculate a normal for a point since it is not a part of a polygon ? ... only one point in 3D space.Thanks for your help ;)
  Up ?After several tests, I can understand the basics of VertexBuffer. Now, I have created a "Model3D" class for my meshes.Each instance has its own VertexBuffer object. I do this because I can't understand how using only one VBO for all my meshes. Certainly a problem with offsets of my objects in Graphic card memory.So, my "Model3D" class looks like this:-"Vertices" property (List(Of myCustomVertex))-"PrimitiveType" property-"VBO" property (the VertexBuffer for my mesh)-"ParentDevice" property-"InitBuffer" method  This method create the VertexBuffer instance and set the DataStream for this mesh-"Draw" method  calculate the primitive count from the vertices count and primitive type.  Set the stream source.  Set the vertex format.  Draw the mesh using "DrawPrimitives".Is it a "good workflow" ?I can put here my entire code, but it's splitted in many classes.   ;Quote:Original post by NorrisIs it best to define only one vertex buffer for all my meshes or one vertex buffer per mesh ?It's easiest to have a VB per mesh. It's most efficient but also most complex to have several VBs, each VB containing a number of meshes.Quote:I know I must define a normal for each polygon and I know how to do.You don't have to define a normal, it depends on what you're doing.Quote:But is it possible to calculate a normal for a point since it is not a part of a polygon ? ... only one point in 3D space.You can pick an arbitrary normal for a point, but there's no sensible way of calculating one, if you think of a point as a tiny sphere then a sphere has lots of normals all the way around it.Quote:Is it a "good workflow" ?Looks alright to me. I'd probably make InitBuffer a constructor but it's the same idea. Also the Flexible Vertex Format is a bit old now but they are nice and easy to use so you may or may not want to use them anyway. At least for educational purposes though you might want to look at their modern replacement, Vertex Declarations.   ;  Hi dmatter and thanks for your opinion.Quote:You don't have to define a normal, it depends on what you're doing.I agree, for the moment, I define a default vector. But my point cloud has many points very close to the other. So, If my camera is far away from it, it seems to be flat.Maybe I can calculate different colors for vertices to simulate this ?Thanks to for the Vertex declaration tip   