Advertisement Jump to content
Sign in to follow this  

How to sort or make a sorted draw call on a mesh hierarchy?

This topic is 624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to sort the meshes which were read from assimp.

The assimp just read the asset file from start to end, pushing the first node found to the list, then the next one over and over again

Recently, I got a material problem with those meshes during rendering,

I suspected there was the material problem, but it wasn't.

The problem was the mesh hierarchy was drawn in the wrong order.

Let's say, the Shirt and pants are drawn first, and lastly the body, which makes the body the last layer to be drawn.

But assimp has no concept of mesh sorting,

How do I go about sorting the meshes in a hierarchy anyways?



Share this post

Link to post
Share on other sites

Well it gives you all the tools to do this yourself.  Have you looked at AssImp tutorials?!Model-Loading/Assimp

What areas exactly are you having issues with?  The first link should provide plenty of help honestly, as it kinda does what you want.  Extracts each mesh out.  You can also resort them yourself.  Or maybe your software is not exporting it correctly.  So many possibilities.

Share this post

Link to post
Share on other sites

Hi Mike,

Thanks for helping.

The mesh I am rendering with assimp is a human  body.

There is only one mesh in there, which encompasses the body, the shirt and the pants.

When  loading up, the mesh got splitted into 3 submeshes.

And the submeshes coordinates were recalculated.

The order probably didn't matter much

And the body skin say is tanned.

and the shirt is slightly yellow

and the pants are blue.

What I see is total yellow, which is not correct.

However, when I enlarge the pants slightly, I see the pants rendered correctly in blue.

So there is some fighting between the pants submesh and the body submesh.

I am not sure I got control over it, but let me read the articles you provided



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!