Skip to content
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

fix MagFiler #945

Merged
merged 2 commits into from
May 14, 2021
Merged

fix MagFiler #945

merged 2 commits into from
May 14, 2021

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue commented May 13, 2021

#943

  • magFilter が glTF の仕様を守っていないのを修正
  • DIVIDE_VERTEX_BUFFER 時に position の accessor に min, max が無かったのを修正

@ousttrue ousttrue marked this pull request as ready for review May 13, 2021 09:59
@ousttrue ousttrue requested a review from Santarh May 13, 2021 10:00
@@ -33,6 +33,9 @@ public void Push(Vector3 position, Vector3 normal)
public gltfMorphTarget ToGltf(glTF gltf, int bufferIndex, bool useNormal)
{
var positionAccessorIndex = gltf.ExtendBufferAndGetAccessorIndex(bufferIndex, m_positions.ToArray(), glBufferTarget.ARRAY_BUFFER);
gltf.accessors[positionAccessorIndex].min = m_positions.Aggregate(m_positions[0], (a, b) => new Vector3(Mathf.Min(a.x, b.x), Math.Min(a.y, b.y), Mathf.Min(a.z, b.z))).ToArray();
gltf.accessors[positionAccessorIndex].max = m_positions.Aggregate(m_positions[0], (a, b) => new Vector3(Mathf.Max(a.x, b.x), Math.Max(a.y, b.y), Mathf.Max(a.z, b.z))).ToArray();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど

Copy link
Contributor

@Santarh Santarh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそう

@@ -8,7 +8,24 @@ namespace UniGLTF
public static class TextureSamplerUtil
{
#region Export
public static glFilter ExportFilterMode(Texture texture)
// MagFilter は 2種類だけ
public static glFilter ExportMagFilter(Texture texture)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magnification

}
}

public static glFilter ExportMinFilter(Texture texture)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minification

@Santarh Santarh merged commit ef81a65 into vrm-c:master May 14, 2021
@ousttrue ousttrue deleted the fix/magFilter branch May 17, 2021 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants