-
I've noticed that the meshlets generated from my models are mostly great, nicely localized, etc. But I am seeing some meshlets built from meshopt_buildMeshlets() that aren't contiguous, i.e. parts are separated in space. In my first screenshot, I am rendering a (subdivided) cube, and you can get an idea of the typical meshlet radius here. The second screenshot shows a single (disjoint) meshlet, and the resulting (large) bounding sphere. Due to the size of the sphere, frustum culling isn't removing meshlet chunks that are well outside the frustum, and I'm just wondering if ending up with some meshlets like this is to be expected. The microsoft meshlet cull demo has nice clean culling outside the view frustum. It's still somewhat jaggy looking of course because we're culling at the level of meshlets, but there aren't any meshlet chunks clearly outside the frustum. I'm wondering if there's some additional processing I need to do to the models, if this is normal behavior for the meshlet builder? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
These should be rare but yeah it's expected that sometimes you get these. The basic example is that when you start from a not-fully-connected mesh then unless each connected region of the mesh fits neatly into an integer number of meshlets, the builder will be forced to either generate partial meshlets, or merge meshlets from multiple locations into one, even though that results in larger bounds. Right now it always prefers the former. When the source mesh is fully connected, because the meshlet builder doesn't use graph partitioning, there are cases where the greedy algorithm leaves chunks that are smaller than max meshlet size and they need to be put into some meshlet - again, right now the builder always prioritizes fully packed meshlets if possible so this can happen as well. It might be possible to adjust the greedy prioritization heuristic to reduce the chance that this can happen, but I don't think it's feasible to eliminate it as a possibility. |
Beta Was this translation helpful? Give feedback.
These should be rare but yeah it's expected that sometimes you get these. The basic example is that when you start from a not-fully-connected mesh then unless each connected region of the mesh fits neatly into an integer number of meshlets, the builder will be forced to either generate partial meshlets, or merge meshlets from multiple locations into one, even though that results in larger bounds. Right now it always prefers the former.
When the source mesh is fully connected, because the meshlet builder doesn't use graph partitioning, there are cases where the greedy algorithm leaves chunks that are smaller than max meshlet size and they need to be put into some meshlet - again, right now…