Skip to content

An alternative set of eyes with support for glTF/GLB export #334

@met4citizen

Description

@met4citizen

In web apps using our TalkingHead module, the camera view is often a close-up of the character's face, so the eyes are a very prominent feature. Unfortunately, Blender has very limited support for shader nodes that can be exported to the glTF/GLB format. Therefore MPFB's procedural eyes, for example, cannot be used. And while MakeSkin/GameEngine eyes can be made compatible with small shader setup changes (removing the current color mix node that is not supported), the result is not as good visually. In addition, the current eye textures are quite large for web app use, typically >600kB each.

To address these issues, I have tried to find a good compromise between high quality, glTF/GLB compatibility, and small file size.

As part of my experimentation, I created a new set of eyes in a few different colors. I used the existing eyeball texture as a starting point, replaced the irises, added normal maps, added a reflective material for the cornea, and designed a simple shader node setup compatible with glTF/GLB export.

In addition, to decrease the exported file size, I used the WebP image format instead of PNG. I used a low compression rate so the quality remains high, but the file size is now only around 100 kB in total for diffuse + normal. The compression could, of course, be done also when actually exporting, or by using a tool like glTF_Transform after the export.

Here are a couple of examples for brown and light blue eyes at the moment. First is the current MakeSkin eyes for comparison, followed by the new glTF/GLB-version.

Image

Image

Image

Image

Here is my simple shader setup for the eyes. The "Math" and "Normal Map" nodes used here are supported by the Blender glTF exporter. The exporter does not support any color mix nodes, so each eye color must have its own separate diffuse file:

Image

In addition to the above, I have a separate transparent material for the cornea.

Now I'm trying to find the best way to share these glTF/GLB-compatible eyes with our TalkingHead developers as easy-to-use assets. I haven't created any eyes, clothes, or materials using MPFB before, so I was wondering whether the two-material shader setup (eyes + cornea) can be created using .mhmat files, or if that would require code changes?

Any ideas or suggestions on the best approach going forward with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    support requestNeed help with something which isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions