Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to control the char number of output mesh? #18

Closed
KickRooster opened this issue May 23, 2018 · 8 comments
Closed

How to control the char number of output mesh? #18

KickRooster opened this issue May 23, 2018 · 8 comments

Comments

@KickRooster
Copy link

222222
The image above is my unwrapped uv's world position which I used to bake lightmap.The mesh is the gun from the famous PBR assets. I hope to decrease output chart number, but I don't know which paramaeter can do this.
Thanks in advance.

@castano
Copy link
Contributor

castano commented May 23, 2018

It looks as if your mesh was disconnected. The atlas tool is not able to merge disconnected mesh pieces. It expects you to provide a mesh where each connected component has shared vertices. You can join the vertices trivially if you know the mesh is 2-manifold, otherwise it's much more tricky and I recommend exporting the topology information from the authoring tool. Hope this helps!

@castano
Copy link
Contributor

castano commented May 23, 2018

Also, can you point to the asset you are using? I can take a look at it and check if this is indeed the problem.

@KickRooster
Copy link
Author

KickRooster commented May 24, 2018

Yes, my testing mesh was disconnected, I have given up all optimization when imported it.The indices have the same count as the vertex, they are all 100629.My testing mesh was downloaded from http://artisaverb.info/PBT.html, you can download it at the bottom of the web page : ).
And then since I have got the reason, I resume vertex merge optimization when imported.Too sad atlas_generate() will access invalid memory address so to throw a exception for this testing mesh.I use assimp to load mesh.I will debug into it to get why it can access invalid memory address, I think it's the last step before I inject thekla_atlas into our baking engine.
Thank you very much for your help.

@KickRooster
Copy link
Author

KickRooster commented May 24, 2018

And, I initialized the input mesh as the following code snippet, although I don't know what's the meaning of first_colocal.
3333

@castano
Copy link
Contributor

castano commented May 24, 2018 via email

@KickRooster
Copy link
Author

KickRooster commented May 25, 2018

I have understood the meaning of the first colocal index by your replay.
By using it marking out disconnected edge so I can split mesh into different charts. I will take some time to record vertex merge info when import it to generate the first colocal index info to generate lightmap uv further.
And then I will go to resolve the "non-manifold mesh" problem.Because I have never met it before. : ).

@castano
Copy link
Contributor

castano commented May 29, 2018

You may not have to worry about non-manifold meshes. In many cases meshes are already split into groups and each group is manifold, so as long as you only connect/merge vertices within the same group you should be fine. Anyway, good luck with your project!

@castano castano closed this as completed May 29, 2018
@KickRooster
Copy link
Author

KickRooster commented May 30, 2018

Hi, I'm back. Thanks for your prompt about non-manifold meshes first, although I have not met it till now. : )
I have been working for filling index info into the first colocal index for these days, and now it works for one of my testing mesh.It looks like this, wonderful!
forgit
But there is a mesh making my program crashed when atlas_generate() was called. Would you help me to have a look at whether it crashed on your environment? : ) Here is the compressed mesh file:
Cerberus_LP.zip
Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants