-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TEXCOORD_1 は export しない #2172
TEXCOORD_1 は export しない #2172
Conversation
/// <summary> | ||
/// Export TEXCOORD_1 | ||
/// </summary> | ||
public bool ExportUvSecondary; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
将来的に uv 3 番目、4 番目…となる可能性はあると思うが、じゃあ bool[]
とかにするかというとそれも違うなあとは思うので、そうなったら愚直に追加でいいか。
/// </summary> | ||
public bool KeepVertexColor; | ||
public bool ExportVertexColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ついでに Rename?
@@ -43,12 +43,16 @@ public static class MeshExporter_SharedVertexBuffer | |||
} | |||
|
|||
var uvAccessorIndex0 = data.ExtendBufferAndGetAccessorIndex(mesh.uv.Select(y => y.ReverseUV()).ToArray(), glBufferTarget.ARRAY_BUFFER); | |||
var uvAccessorIndex1 = data.ExtendBufferAndGetAccessorIndex(mesh.uv2.Select(y => y.ReverseUV()).ToArray(), glBufferTarget.ARRAY_BUFFER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
従来はデフォルトで UV2 を出力していた
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おそらく、#1798 を契機に mesh.uv2 が null にならなくなったと思われます。
で mesh エクスポートの経路が glbとvrm0(shared / divided) + vrm1 で3種類あって、
今回修正した glb/vrm0 shared だけ uv2 が漏れ出るようになってしまった。
他の2本は、あとで作ったときに最初から uv2 をオミットしているぽい。
vertexbuffer(shared) が歴史的経緯により一番古い。
var uvAccessorIndex1 = -1; | ||
if (settings.ExportUvSecondary) | ||
{ | ||
uvAccessorIndex1 = data.ExtendBufferAndGetAccessorIndex(mesh.uv2.Select(y => y.ReverseUV()).ToArray(), glBufferTarget.ARRAY_BUFFER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体的な出力実装は変えず、出力するかどうかを選択式にした
fixed #2167
現状、Unity 上で2番目以降の UV を正しく反映する実装が無いのでエクスポートしない。
正しく反映 するには glTF と互換性のある shader にする必要があるのだが、
Unity の Standard と glTF の仕様が違うので対応予定無し。
https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/textureInfo.schema.json#L13