Wednesday, 1 May 2024
Copy Vertex Data
On both the console games (e.g. Alien: Isolation) and Total War games (e.g. Total War: Three Kingdoms) there has commonly been a request to have the ability to copy vertex data from one mesh to another with differing geometry.
A good example would be the copying of vertex data (usually colour or alpha) down a LOD chain where the geometry differs but visually they still have to look alike.
The brute force solution for this is to take each vertex on the target mesh, then find the closest vertex on the source mesh before copying over the relevant vertex data.
However, this approach becomes exponentially slower to calculate as the vertex count rises on the source and/or target mesh.
The real problem to solve here is to try and achieve the same results the brute force approach gives but in a much qmore optimal way.
The solution I implemented was to initially do a mesh element matching pass i.e. run the same closest-neighbour approach but with elements instead of vertices.
Once there was an element correlation between the source and target meshes it was then just a matter of running the brute force approach but, this time, with a lot less vertices to check and match up.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment