Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Morph data and mesh data, how can I handle this?

Featured Replies

I am researching model files in a game. There are two types of files (base model and specific model), where base model has all vertex, face, UV data and specific model has only vertices

To create the specific shape, game uses a formula for vertices as vertex of base + vertex of specific model I made a compilation of process at the attached image.

Now, the issue I am facing is, the base face has 734 vertices (there are duplicates, not merged) but morph data has 573 vertices (no duplicates). It is easier to create a script that makes this reverse conversion so I can edit vertices in Blender. How can I handle this? Hopefully I could explain myself.

image.thumb.png.8a0a43531e37f9f8ca314e8c0f2aebd6.png

  • Supporter

Hello
From my experience, morph data are stored as sparse additive vertices.

Like you described, base buffer has all vertex data, while morph targets mostly store additive positions and sometimes normals (well you can store anything, the sky is a limit, but those two attributes are prominent)

In addition, morph data tends to be stored as sparse attributes. That means each morph target uses it's own unique vertex set, that is indexed onto base buffer via it's own index table.

Example pseudo code:

for (int v = 0; v < numVertices; v++) {
  outVertPos[v] = baseVertPosition[v] + morphVertPosition[morphSparseIndices[v]];
}

If you want even info, here is great resource: https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc#sparse-accessors

Edited by Maxwell

  • 1 month later...
  • Author

Hi, thanks for your response.

Yes what you meant makes sense. In my case it looks like sparse indices are stored in specific file. Problem is I don't know how they are stored. 2 bytes? 4 bytes? What kind of integer could it be? Repeatedly tried looking into file but couldn't come up with a solution.

I found UV map locations and vertex locations on the file, but have no idea on morph indices.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.