2
$\begingroup$

When I export my model to a glb or gltf format (This is for a game), the texture gets messed up. The texture is just a simple png file with color strips in it, nothing fancy. What's going on? I've tried to export in almost every format blender offers with similar results.

The only thing that even kept the colors in the right place was to move the base color to the emission and change the base color to black. That comes from a stackexchange answer, which I can't seem to find at the moment. But it makes the model look really weird.

This is the original model

enter image description here

Here's what it looks like after exporting.

enter image description here

$\endgroup$

2 Answers 2

3
$\begingroup$

Your model has a vertex color layer that is black everywhere but the hands. In glTF the first vertex color layer is always multiplied into the base color, so anywhere the vertex color is black, the base color will be black.

You can check what happened by reimporting the .glb into Blender and comparing against your original material. Here's the nodes you'll get.

Nodes for multiplying texture and vertex color

See the "multiply by vertex colors" part that got added?

You can fix this by just deleting the vertex color layer.

Btw there is also another difference you might notice: you've used a "Non-Color" texture for the base color. The glTF exporter expects an "sRGB" texture (it will not convert colorspaces for you) so you will also need to convert your image to SRGB if you want the colors to be the same.

$\endgroup$
3
  • $\begingroup$ I see what you're talking about (I actually changed it from sRGB because I thought the Godot documentation mentioned I needed to do that). As for the Vertex Color, deleting that fixes it when I reimport, but it will just show back up when I try to export again. I'm not sure how to avoid it. $\endgroup$ Sep 19, 2021 at 22:01
  • $\begingroup$ I'm saying delete the vertex color layer itself (ie. in the Properties editor) before you export. Not the nodes. $\endgroup$
    – scurest
    Sep 19, 2021 at 22:05
  • $\begingroup$ Thanks! That did the trick. No idea why there was a vertex color there in the first place. But I didn't make this model, just made some edits, and generated an animation. $\endgroup$ Sep 19, 2021 at 22:58
1
$\begingroup$

For anybody that stumbles upon this later, to delete the vertex color go to

Object Data Properties (Green upside down triangle) -> Vertex Colors (Click on it to open the drop down) -> Hit the minus button to remove the vertex color. (In my case it was something named Col)

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .