-
|
Hi. This is primarily idle curiosity: I noticed that I get a 2-3x reduction in frame rate when I randomize the order of the faces in my mesh. I'm guessing this is due to worse cache locality after jumbling the face order? Assuming that's the case: what is the optimal ordering? Or the other way around: does the rendering pipeline process the faces in the order they are provided and that order is optimal when indexing into the vertex positions is maximally local? # Good
faces = [[0, 1, 2], [0, 1, 3], ..., [100, 101, 102]]
# Bad
faces = [[0, 1, 2], [100, 101, 102], ..., [0, 1, 3]] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
These observations should also be dependent on the rendering pipeline configuration and the specific shader being used, as this determines the buffer sampling patterns. But yes in general for mesh shading this is accurate:
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks for confirming! I've been reading up a little on mesh optimisation for rendering (e.g. face/vertex sorting based on Hilbert curves, BFS or spectral clustering) and I smell a little side project. I did also come across meshoptimizer which luckily seems to have a Rust crate. I might write a little Python wrapper for it and how much difference it can make. |
Beta Was this translation helpful? Give feedback.
These observations should also be dependent on the rendering pipeline configuration and the specific shader being used, as this determines the buffer sampling patterns.
But yes in general for mesh shading this is accurate: