Hi GD.net
I have a quick question about mesh shaders. Can you have overlapping vertices or should they be welded prior to running it through a splitter software?
This is what i mean:
Thanks!
Hi GD.net
I have a quick question about mesh shaders. Can you have overlapping vertices or should they be welded prior to running it through a splitter software?
This is what i mean:
Thanks!
Newgamemodder said:
Can you have overlapping vertices or should they be welded prior to running it through a splitter software?
What is a ‘splitter’ software?
In general, during modeling, you want to avoid duplicated vertices, because they break things like smooth shading or geometry subdivision. So you weld those vertices. In the 3D modeling software there also is no need for duplicated vertices at UV chart boundaries, etc. In practice you will weld vertices all the time to have a better workflow.
After the modeling we need to preprocess the mesh at some point so it can be processed by the GPU. This applies some changes:
Mesh adjacency information is removed. For rendering we don't need to know which triangle is at the other side of an edge.
Vertices are duplicated along UV seams, differing normals, or differing materials. (Maybe that's what you mean with splitting)
Vertices are reordered in memory for cache efficiency. It's important that vertices which are close in space are also close in memory, so the GPU threads don't need to do big jumps in VRAM which causes cache misses and bad performance.
If we want to use mesh shaders, we likely generate small clusters over the surface, called ‘meshlets’. Reason is similar: All threads of a mesh shader workgroup ideally load their vertices from a linear range of VRAM.
This is software which can do all those pre-processing tasks: https://github.com/zeux/meshoptimizer
Game engines do those things as part of their asset processing pipeline. You can import a model from Blender, Maya, etc., then it creates the optimized data and stores it as an ‘asset’ on disk. And then you only use this data for the game.
Ofc. you need to keep the original model data too for eventual future changes, since you can not convert from a game asset back to Blender without data loss / corruption.
So, notice that the ‘3D model’ and the ‘game asset’ are two different things, and only the final visualization is the same.
This also implies that artwork is (usually) not affected from specific technical requirements of game engines or GPUs (beside things like given polygon count budget's ofc.)
Hi Joe,
If the model looks fine but has duplicated/overlapping vertices should i weld them?, only asking since it's a 3 mil triangle mesh i have and going through all the vertices 1 by 1 is impossible. Should i instead have the model redone with welding?
By "splitter" i mean something that converts a mesh into meshlets
EDIT: Is it as simple as welding 0.001 in 3ds max or in blender?
Newgamemodder said:
If the model looks fine but has duplicated/overlapping vertices should i weld them?, only asking since it's a 3 mil triangle mesh i have and going through all the vertices 1 by 1 is impossible. Should i instead have the model redone with welding?
Sounds you have a problem with modeling. Why are those vertices duplicated or overlapping? It should not be like that in the first place.
But ofc. this constantly happens if you rip assets, which is common in modding.
Anyway - it's something you want to automate…
Newgamemodder said:
EDIT: Is it as simple as welding 0.001 in 3ds max or in blender?
Exactly. Those tools often also have more detailed settings to help with that.
Typically you can automate it, but some manual cleanup work on failure cases is needed.
However, if those duplicates are no problem visually or for ongoing modeling, there might be no need to change it.
Tools like a meshlet builder might be affected or not, and the affect might bad or not.
I would not yet mess around just because of such specualtions.
Actually the mesh isn't ripped for once heh. Trying to use as many unripped models as possible. It's because it's made by somebody who doesn't make game ready models.
About the duplicated/overlapping vertices it's got no problem visually.
Hmm i'll guess i have to wait for gui version of a meshlet building, the existing ones are too complicated for me :/
Doesn't matter who made a mesh, it should be mostly merged unless artistically choosing to make flat shaded faces.
My guess is you imported a model that was exporting each triangle with 3 unique vertices, rather than a list of welded verts and a list of triangles made of those existing vertices.
In Blender you can use Merge→By Distance (In newer blenders I think its “M” hotkey, older is ALT +M).
I don't know if Blender has a split functionality, if it does I don't know if it preservers smooth vertex normals or not either. But yes by default you should just merge everything by distance. If nothing changes visibly then your source model is definitely exported very stupidly.
NBA2K, Madden, Maneater, Killing Floor, Sims
So i tried welding in blender. Says it removes some vertices 1.8k. Import into 3ds max it says there a 3k overlapping. try to weld 0.001, Nothing happens, model stays the same
Can i ignore touching the welds of models or can this affect them if i “make meshlets” of them? Or is this unknown territory?
Newgamemodder said:
Can i ignore touching the welds of models or can this affect them if i “make meshlets” of them? Or is this unknown territory?
Assuming your duplicates are along some reasonable borders, e.g. sharp edges or differing materials, the splitter would split at those same places anyway.
So there may be no need to weld.
If you want to decide now, here's the objectives of such meshlet generator:
All triangles of a meshlet should have similar normals, so normal cone culling can quickly cull backfacing meshlets. This means the splitter will cut along corners. (helpful)
Ideally all meshlets have the same number of triangles, and the boundary of the cluster is short. (irrelevant)
Respecting material boundaries can be an objective - depends on chosen rendering methods. (probably unknown)
Regarding 3Ds, iirc it has multiple functions, maybe ‘weld’, ‘join’, or ‘fuse’, etc. Maybe you have not yet found the proper tool for the task.