Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #200 from donmccurdy/sample-morphprimitivestest
Browse files Browse the repository at this point in the history
Add MorphPrimitivesTest.
  • Loading branch information
emackey committed Oct 31, 2018
2 parents 1c0af37 + 68a1c66 commit 9fc5079
Show file tree
Hide file tree
Showing 9 changed files with 365 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 2.0/MorphPrimitivesTest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Morph-Primitives Test

## Screenshot

![screenshot](screenshot/screenshot.jpg)

## Description

This model contains a simple mesh with two primitives: A larger red primitive displays a grid covering 3 of the 4 quadrants of the model's area, followed by a smaller green primitive covering the last quadrant.

Each primitive has a morph target that creates an elevated area within these quadrants. The model's only mesh contains a `weights: [0.5]` instruction that should cause these morph targets to be applied at half strength, raising the center of the model as shown in the screenshot above.

## Common Problems

If the entire model appears perfectly flat, it is likely that the morph targets have not been applied as requested.

If the red area or green area is missing, particularly in the Draco-compressed version of this model, it could indicate a problem with decompression or with support of multiple primitives within a single mesh.

## License Information

Model by [@ft-lab](https://github.com/ft-lab).

CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/
Binary file not shown.
Binary file not shown.
Binary file not shown.
331 changes: 331 additions & 0 deletions 2.0/MorphPrimitivesTest/glTF/MorphPrimitivesTest.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,331 @@
{
"asset": {
"generator": "glTF Converter for Shade3D",
"version": "2.0",
"extras": {
"title": "multiple_primitives",
"author": "ft-lab",
"license": "CC BY-4.0 (https://creativecommons.org/licenses/by/4.0/)"
}
},
"accessors": [
{
"bufferView": 0,
"componentType": 5123,
"count": 72,
"type": "SCALAR",
"byteOffset": 0
},
{
"bufferView": 1,
"componentType": 5126,
"count": 21,
"type": "VEC3",
"byteOffset": 0
},
{
"bufferView": 2,
"componentType": 5126,
"count": 21,
"type": "VEC3",
"max": [
0.5,
0,
0.5
],
"min": [
-0.5,
0,
-0.5
],
"byteOffset": 0
},
{
"bufferView": 3,
"componentType": 5126,
"count": 21,
"type": "VEC2",
"byteOffset": 0
},
{
"bufferView": 4,
"componentType": 5126,
"count": 21,
"type": "VEC3",
"max": [
0,
0.20000000298023224,
0
],
"min": [
0,
0,
0
],
"byteOffset": 0
},
{
"bufferView": 5,
"componentType": 5123,
"count": 24,
"type": "SCALAR",
"byteOffset": 0
},
{
"bufferView": 6,
"componentType": 5126,
"count": 9,
"type": "VEC3",
"byteOffset": 0
},
{
"bufferView": 7,
"componentType": 5126,
"count": 9,
"type": "VEC3",
"max": [
0.5,
0,
0
],
"min": [
0,
0,
-0.5
],
"byteOffset": 0
},
{
"bufferView": 8,
"componentType": 5126,
"count": 9,
"type": "VEC2",
"byteOffset": 0
},
{
"bufferView": 9,
"componentType": 5126,
"count": 9,
"type": "VEC3",
"max": [
0,
0.20000000298023224,
0
],
"min": [
0,
0,
0
],
"byteOffset": 0
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 144,
"target": 34963
},
{
"buffer": 0,
"byteOffset": 144,
"byteLength": 252,
"target": 34962,
"byteStride": 12
},
{
"buffer": 0,
"byteOffset": 396,
"byteLength": 252,
"target": 34962,
"byteStride": 12
},
{
"buffer": 0,
"byteOffset": 648,
"byteLength": 168,
"target": 34962,
"byteStride": 8
},
{
"buffer": 0,
"byteOffset": 816,
"byteLength": 252,
"target": 34962,
"byteStride": 12
},
{
"buffer": 0,
"byteOffset": 1068,
"byteLength": 48,
"target": 34963
},
{
"buffer": 0,
"byteOffset": 1116,
"byteLength": 108,
"target": 34962,
"byteStride": 12
},
{
"buffer": 0,
"byteOffset": 1224,
"byteLength": 108,
"target": 34962,
"byteStride": 12
},
{
"buffer": 0,
"byteOffset": 1332,
"byteLength": 72,
"target": 34962,
"byteStride": 8
},
{
"buffer": 0,
"byteOffset": 1404,
"byteLength": 108,
"target": 34962,
"byteStride": 12
}
],
"buffers": [
{
"name": "MorphPrimitivesTest",
"byteLength": 1512,
"uri": "MorphPrimitivesTest.bin"
}
],
"images": [
{
"name": "uv_texture.jpg",
"mimeType": "image/jpeg",
"uri": "uv_texture.jpg"
}
],
"materials": [
{
"pbrMetallicRoughness": {
"baseColorFactor": [
1,
0,
0,
1
],
"baseColorTexture": {
"index": 0,
"texCoord": 0
},
"metallicFactor": 0,
"roughnessFactor": 1
},
"name": "red",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
},
{
"pbrMetallicRoughness": {
"baseColorFactor": [
0,
1,
0,
1
],
"baseColorTexture": {
"index": 0,
"texCoord": 0
},
"metallicFactor": 0,
"roughnessFactor": 1
},
"name": "green",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
}
],
"meshes": [
{
"weights": [
0.5
],
"name": "mesh",
"primitives": [
{
"attributes": {
"NORMAL": 1,
"POSITION": 2,
"TEXCOORD_0": 3
},
"indices": 0,
"material": 0,
"targets": [
{
"POSITION": 4
}
],
"mode": 4
},
{
"attributes": {
"POSITION": 7,
"NORMAL": 6,
"TEXCOORD_0": 8
},
"indices": 5,
"material": 1,
"targets": [
{
"POSITION": 9
}
],
"mode": 4
}
]
}
],
"nodes": [
{
"children": [
1
],
"name": "ルートパート"
},
{
"mesh": 0,
"name": "mesh"
}
],
"samplers": [
{
"minFilter": 9729,
"wrapS": 10497,
"wrapT": 10497
}
],
"scenes": [
{
"nodes": [
0
],
"name": "Scene"
}
],
"textures": [
{
"sampler": 0,
"source": 0
}
],
"scene": 0
}
Binary file added 2.0/MorphPrimitivesTest/glTF/uv_texture.jpg
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 2.0/MorphPrimitivesTest/screenshot/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions 2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
| [Alpha Blend Mode Test](AlphaBlendModeTest) | ![](AlphaBlendModeTest/screenshot/screenshot.png) | Tests alpha modes and settings. |
| [Boom Box With Axes](BoomBoxWithAxes) | ![](BoomBoxWithAxes/screenshot/screenshot.jpg) | Shows X, Y, and Z axis default orientations. |
| [Metal Rough Spheres](MetalRoughSpheres) | ![](MetalRoughSpheres/screenshot/screenshot.png) | Tests various metal and roughness values. |
| [Morph Primitives Test](MorphPrimitivesTest) | ![](MorphPrimitivesTest/screenshot/screenshot.jpg) | Tests a morph target on multiple primitives. |
| [Multi UV Test](MultiUVTest) | ![](MultiUVTest/screenshot/screenshot.jpg) | Tests a second set of texture coordinates. |
| [Normal Tangent Test](NormalTangentTest) | ![](NormalTangentTest/screenshot/screenshot.png) | Tests an engine's ability to automatically generate tangent vectors for a normal map. |
| [Normal Tangent Mirror Test](NormalTangentMirrorTest) | ![](NormalTangentMirrorTest/screenshot/screenshot.png) | Tests an engine's ability to load supplied tangent vectors for a normal map. |
Expand All @@ -77,6 +78,7 @@
| [Vertex Color Test](VertexColorTest) | ![](VertexColorTest/screenshot/screenshot.png) | Tests if vertex colors are supported. |

## Extension Test Models

| Model | Screenshot | Description |
|-------------------------------------------------------|---------------------------------------------------------------|-------------|
| [SpecGloss Vs MetalRough](SpecGlossVsMetalRough) | ![](SpecGlossVsMetalRough/screenshot/screenshot.jpg) | Tests if KHR_materials_pbrSpecularGlossiness extension is supported properly. |
Expand Down
9 changes: 9 additions & 0 deletions 2.0/model-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@
"glTF-pbrSpecularGlossiness": "Monster.gltf"
}
},
{
"name": "MorphPrimitivesTest",
"screenshot": "screenshot/screenshot.jpg",
"variants": {
"glTF": "MorphPrimitivesTest.gltf",
"glTF-Binary": "MorphPrimitivesTest.glb",
"glTF-Draco": "MorphPrimitivesTest.glb"
}
},
{
"name": "MultiUVTest",
"screenshot": "screenshot/screenshot.jpg",
Expand Down

0 comments on commit 9fc5079

Please sign in to comment.