Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX: meshes assembled into model VS ID3DX10Mesh


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Xcrypt   Members   -  Reputation: 154

Like
0Likes
Like

Posted 03 May 2012 - 06:26 AM

Hi, currently I'm looking into supporting 3D models for my graphics engine.


This is how the core parts of my graphics engine work atm:

class Geometry: consists of a vertexbuffer and an indexbuffer (optional)
class Mesh: consists of the data for a single mesh to be drawn: geometry, material, etc
class Renderer: sorts Meshes according to material and does some additional optimising for execution speed, also renders the actual meshes.


Now, I was planning to create a model class, which could hold several meshes, so 3d models could be drawn with multiple geometries all having their own material.
However, I recently came across something called ID3DX10Mesh. Apparently ID3DX10Mesh has the option to do this:


// Reorder the vertices according to subset and optimize the mesh for this graphics
// card's vertex cache. When rendering the mesh's triangle list the vertices will
// cache hit more often so it won't have to re-execute the vertex shader.
HR( m_pID3DX10Mesh ->GenerateAdjacencyAndPointReps( 1e-6f ) );
HR( m_pID3DX10Mesh ->Optimize( D3DX10_MESHOPT_ATTR_SORT | D3DX10_MESHOPT_VERTEX_CACHE, NULL, NULL ) )
They also allow different materials for one ID3DX10Mesh

I'm wondering if I should go through with my original idea, or use these ID3DX10Meshes. I do have the problem however that using those ID3DX10Meshes might mess up my renderer quite a bit.

What is generally done for good performance regarding this matter?

Thanks in advance.

Sponsor:

#2 Vorel512   Members   -  Reputation: 130

Like
0Likes
Like

Posted 03 May 2012 - 08:03 AM

Hi there!

Usually the built in functions are faster than a thing you write, because they are working directly with the DX "core". But testing is always a good idea, nobody is a god, so there can be functions that fit more for you.
In your case maybe I would go for the hand written one, maybe some day that knowledge will be useful.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS