Skip to content

Commit

Permalink
Merge pull request #814 from cx20/add_gltf_sample_models
Browse files Browse the repository at this point in the history
Add glTF Sample Models
  • Loading branch information
cx20 authored Dec 19, 2024
2 parents 258af0a + 0f15b63 commit 6d41307
Show file tree
Hide file tree
Showing 144 changed files with 67,429 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/babylonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ let createScene = function(engine) {
if ( variantsExtension != null ) {
variants = variantsExtension.getAvailableVariants(parentMesh);
if (variants.length > 0 ) {
VARIANT = modelInfo.variant == undefined ? DEFAULT_NAME : modelInfo.variant;
params.VARIANT = modelInfo.variant == undefined ? DEFAULT_NAME : modelInfo.variant;
let variantNames = variants.reduce(function (allNames, name) {
allNames[name] = name;
return allNames
}, {});
variantNames[DEFAULT_NAME] = DEFAULT_NAME;
guiVariants = gui.add(params, 'VARIANT', variantNames).name("Variant");
variantsExtension.selectVariant(parentMesh, VARIANT)
variantsExtension.selectVariant(parentMesh, params.VARIANT)

guiVariants.onChange(function (value) {
if (value == DEFAULT_NAME) {
Expand Down
4 changes: 2 additions & 2 deletions examples/babylonjs_webgpu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ let createScene = async function(engine) {
if ( variantsExtension != null ) {
variants = variantsExtension.getAvailableVariants(parentMesh);
if (variants.length > 0 ) {
VARIANT = modelInfo.variant == undefined ? DEFAULT_NAME : modelInfo.variant;
params.VARIANT = modelInfo.variant == undefined ? DEFAULT_NAME : modelInfo.variant;
let variantNames = variants.reduce(function (allNames, name) {
allNames[name] = name;
return allNames
}, {});
variantNames[DEFAULT_NAME] = DEFAULT_NAME;
guiVariants = gui.add(params, 'VARIANT', variantNames).name("Variant");
variantsExtension.selectVariant(parentMesh, VARIANT)
variantsExtension.selectVariant(parentMesh, params.VARIANT)

guiVariants.onChange(function (value) {
if (value == DEFAULT_NAME) {
Expand Down
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ function makeTutorialExtensionTestModelLinks() {
|| modelName == 'MaterialsVariantsShoe'
|| modelName == 'MosquitoInAmber'
|| modelName == 'PotOfCoals'
|| modelName == 'PotOfCoalsAnimationPointer'
|| modelName == 'SheenChair'
|| modelName == 'SheenTestGrid'
|| modelName == 'SpecGlossVsMetalRough'
Expand All @@ -532,12 +533,26 @@ function makeTutorialExtensionTestModelLinks() {
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-Binary', scale));
} else if ( modelName == 'SunglassesKhronos' ) {
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-Binary', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-Draco', scale));
} else if ( modelName == 'StainedGlassLamp' ) {
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-JPG-PNG', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-KTX-BasisU', scale));
} else if ( modelName == 'CarConcept' ) {
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-JPG', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-KTX-BasisU-Draco', scale));
td.appendChild(document.createElement('br'));
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF-WEBP', scale));
} else if (modelName == 'DragonAttenuation') {
td.appendChild(createlink(engines[i].name, 'tutorialModels', modelName, 'glTF', scale));
td.appendChild(document.createElement('br'));
Expand Down Expand Up @@ -622,10 +637,13 @@ function replaceContentName(type) {
"glTF-Quantized": "[Quantized]",
"glTF-IBL": "[glTF-IBL]",
"glTF-BasisU": "[BasisU]",
"glTF-JPG": "[JPG]",
"glTF-JPG-PNG": "[JPG/PNG]",
"glTF-KTX-BasisU": "[KTX/BasisU]",
"glTF-KTX-BasisU-Draco": "[KTX/BasisU/Draco]",
"glTF-Draco-KTX2": "[Draco-KTX2]",
"glTF-KTX2": "[KTX2]",
"glTF-WEBP": "[WEBP]",
"glTF-Meshopt": "[Meshopt]",
"glTF-Meshopt-KTX2": "[Meshopt-KTX2]",
}
Expand Down
19 changes: 19 additions & 0 deletions tutorialModels/CarConcept/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# LICENSE file for the model: CarConcept

All files in this directory tree are licensed as indicated below.

* All files directly associated with the model including all text, image and binary files:

* [CC BY 4.0 International]("https://creativecommons.org/licenses/by/4.0/legalcode") [SPDX license identifier: "CC-BY-4.0"]

* [Khronos Trademark or Logo]("") [SPDX license identifier: "LicenseRef-LegalMark-Khronos"]

* [Khronos Trademark or Logo]("") [SPDX license identifier: "LicenseRef-LegalMark-Khronos"]

* This file and all other metadocumentation files including "metadata.json":

* [Creative Commons Attribtution 4.0 International]("https://creativecommons.org/licenses/by/4.0/legalcode") [SPDX license identifier: "CC-BY-4.0"]

Full license text of these licenses are available at the links above

#### Generated by modelmetadata
Loading

0 comments on commit 6d41307

Please sign in to comment.