Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

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

This topic is 524 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?

Thanks

Jack

Share this post


Link to post
Share on other sites
Advertisement

Well it gives you all the tools to do this yourself.  Have you looked at AssImp tutorials?

https://learnopengl.com/#!Model-Loading/Assimp

http://assimp.org/lib_html/index.html

    http://assimp.org/lib_html/usage.html

https://github.com/assimp/assimp/tree/master/samples/SimpleOpenGL/

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

Thanks

Jack

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!