Skip to content

Commit

Permalink
Add in MultiUVTest from sample models for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb committed Aug 25, 2023
1 parent 7be1cab commit efd87b7
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 1 deletion.
15 changes: 15 additions & 0 deletions resources/glTF_import/MultiUVTest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# MultiUV Test

## Screenshot

![screenshot](screenshot/screenshot.jpg)

## Description

This model has two uv texture coordinates.

## License Information

Donated by [Hilo3d](https://github.com/hiloteam/Hilo3d) for glTF testing.

This model is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
Binary file not shown.
256 changes: 256 additions & 0 deletions resources/glTF_import/MultiUVTest/glTF/MultiUVTest.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
{
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5121,
"count" : 36,
"max" : [
23
],
"min" : [
0
],
"type" : "SCALAR"
},
{
"bufferView" : 1,
"componentType" : 5126,
"count" : 24,
"max" : [
1.0000004768371582,
1.0,
1.0000005960464478
],
"min" : [
-1.0000003576278687,
-1.0,
-1.0000003576278687
],
"type" : "VEC3"
},
{
"bufferView" : 2,
"componentType" : 5126,
"count" : 24,
"max" : [
1.0,
1.0,
1.0
],
"min" : [
-1.0,
-1.0,
-1.0
],
"type" : "VEC3"
},
{
"bufferView" : 3,
"componentType" : 5126,
"count" : 24,
"max" : [
1.0,
6.661325971652322e-16,
1.0,
1.0
],
"min" : [
-1.0,
-2.9802322387695312e-08,
-1.0,
1.0
],
"type" : "VEC4"
},
{
"bufferView" : 4,
"componentType" : 5126,
"count" : 24,
"max" : [
0.7499566674232483,
0.9999134124518605
],
"min" : [
8.658754813950509e-05,
8.660554885864258e-05
],
"type" : "VEC2"
},
{
"bufferView" : 5,
"componentType" : 5126,
"count" : 24,
"max" : [
0.25,
0.25
],
"min" : [
0.0,
0.0
],
"type" : "VEC2"
}
],
"asset" : {
"copyright" : "hiloteam",
"generator" : "Khronos Blender glTF 2.0 exporter",
"version" : "2.0"
},
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 36,
"byteOffset" : 0,
"target" : 34963
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 36,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 324,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 384,
"byteOffset" : 612,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 192,
"byteOffset" : 996,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 192,
"byteOffset" : 1188,
"target" : 34962
}
],
"buffers" : [
{
"byteLength" : 1380,
"uri" : "MultiUVTest.bin"
}
],
"cameras" : [
{
"name" : "Camera",
"perspective" : {
"aspectRatio" : 1.7777777777777777,
"yfov" : 0.5033799372418416,
"zfar" : 100.0,
"znear" : 0.10000000149011612
},
"type" : "perspective"
}
],
"images" : [
{
"uri" : "uv0.png"
},
{
"uri" : "uv1.png"
}
],
"materials" : [
{
"emissiveFactor" : [
1.0,
1.0,
1.0
],
"emissiveTexture" : {
"index" : 1,
"texCoord" : 1
},
"name" : "Material",
"pbrMetallicRoughness" : {
"baseColorTexture" : {
"index" : 0
}
}
}
],
"meshes" : [
{
"name" : "Cube",
"primitives" : [
{
"attributes" : {
"NORMAL" : 2,
"POSITION" : 1,
"TANGENT" : 3,
"TEXCOORD_0" : 4,
"TEXCOORD_1" : 5
},
"indices" : 0,
"material" : 0
}
]
}
],
"nodes" : [
{
"camera" : 0,
"name" : "Correction_Camera",
"rotation" : [
-0.7071067690849304,
-0.0,
0.0,
0.7071067690849304
]
},
{
"children" : [
0
],
"name" : "Camera",
"rotation" : [
0.483536034822464,
0.33687159419059753,
-0.20870360732078552,
0.7804827094078064
],
"translation" : [
7.481131553649902,
5.34366512298584,
6.5076398849487305
]
},
{
"mesh" : 0,
"name" : "Cube"
}
],
"samplers" : [
{}
],
"scene" : 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
2,
1
]
}
],
"textures" : [
{
"sampler" : 0,
"source" : 0
},
{
"sampler" : 0,
"source" : 1
}
]
}
Binary file added resources/glTF_import/MultiUVTest/glTF/uv0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/glTF_import/MultiUVTest/glTF/uv1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion source/MaterialXglTF/GltfMaterialHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ void addTexCoordNode(NodePtr image, int uvindex)
NodePtr texcoordNode = parentGraph->addNode("texcoord", texcoordName, "vector2");
if (texcoordNode)
{
InputPtr uvIndexInput = texcoordNode->addInputFromNodeDef("uvindex");
InputPtr uvIndexInput = texcoordNode->addInputFromNodeDef("index");
if (uvIndexInput)
{
uvIndexInput->setValue<int>(uvindex);
Expand Down

0 comments on commit efd87b7

Please sign in to comment.