How to work properly with GLB files?

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
negroclarito
Posts: 141
Joined: Sat Feb 27, 2010 9:38 pm

How to work properly with GLB files?

Post by negroclarito »

I'm creating a character in MOHO that needs to be exported to Unity, and I'm running into a lot of problems. Can MOHO GLTF files be used in Unity? When exporting in GLTF, the textures don't show up. Only the GLB file works.

How can I create the eyes using vectors? They don't work well with masks and 2D meshes. When I manage to do it, the pupil looks fine in MOHO, but in the GLB files, the pupil distorts when I use the 2D mesh to close the eye, even if it's not linked to the pupil layer. I also encounter problems when I do face rotations. Is there any way to do this?
I'm also having the issue that in MOHO, the curves in the mesh warp look smooth, but in the GLB files, the curved lines have sharp points. And the edges of the mesh leave a small black line outside that's noticeable on the character. Any advice on how to use it?
User avatar
mgo
Posts: 73
Joined: Thu Dec 05, 2019 6:19 am
Location: Earth, Solar System, Milky Way, Laniakea

Re: How to work properly with GLB files?

Post by mgo »

I'm curious if You found solutions for Your issues? I ran into some myself.

As for GLTF vs GLB, I assume this is just a path/referencing issue. I have no idea about Unity, but GLTF has mesh and texture data separated, with textures being image files stored next to the mesh.

Deformations are well controllable imo. The most important learning was: mesh warp layers are the actual exported geometry (flat 3D geo, made by triangles), while vector layers will be rendered as textures and mapped onto the mesh layers. If You don't use mesh warp layers, moho creates meshes that look like a pixelated version (with huge pixels, which are actually triangulated quads) of Your artwork and usese them to map the rendered textures on them.

I found it helpful to open the GLB files in blender, even manually fix the geo, and export them again as GLB for the target application. Since Moho exports all meshes as triangles, deformations can break the textures in undesired ways. Blender does a nice job preserving the UV projection, You can join tris into quads, or clean up the geo and the texture will stay pinned, unless You change the geometry boundaries.

Finally, the texture border can be problematic since Moho seems to premultiply the color with the alpha. This shouldn't happen, and could be mitigated to some degree with blending modes (again, no idea what one can do in Unity here). Unfortunately, the best way to counter that was to manually correct the texture, again in blender.
🚀
Post Reply