Skip to content

Commit

Permalink
Merge pull request #817 from cx20/improved_screenshot_model_dataset
Browse files Browse the repository at this point in the history
Improved screenshot of model dataset
  • Loading branch information
cx20 authored Dec 21, 2024
2 parents 3d9abdd + 8c09f76 commit 75e99b2
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 298 deletions.
75 changes: 40 additions & 35 deletions sampleModels/model-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,51 @@
var ModelIndex = {};

ModelIndex.List = [
{category:'sampleModels', name:'Box', scale:1.0},
//{category:'sampleModels', name:'BoxWithoutIndices', scale:1.0},
{category:'sampleModels', name:'BoxInterleaved', scale:1.0},
{category:'sampleModels', name:'BoxTextured', scale:1.0},
{category:'sampleModels', name:'BoxTexturedNonPowerOfTwo', scale:1.0},
{category:'sampleModels', name:'Box With Spaces', scale:1.0},
{category:'sampleModels', name:'BoxVertexColors', scale:1.0},
{category:'sampleModels', name:'Duck', scale:1.0},
{category:'sampleModels', name:'2CylinderEngine', scale:0.005},
{category:'sampleModels', name:'ReciprocatingSaw', scale:0.01},
{category:'sampleModels', name:'GearboxAssy', scale:0.2},
{category:'sampleModels', name:'Buggy', scale:0.02},
{category:'sampleModels', name:'BoxAnimated', scale:0.5},
{category:'sampleModels', name:'CesiumMilkTruck', scale:0.5},
{category:'sampleModels', name:'RiggedSimple', scale:0.2},
{category:'sampleModels', name:'RiggedFigure', scale:1.0},
{category:'sampleModels', name:'CesiumMan', scale:1.0},
{category:'sampleModels', name:'Fox', scale:0.02},
{category:'sampleModels', name:'BrainStem', scale:1.0},
{category:'sampleModels', name:'VC', scale:0.2}
{category:'sampleModels', name:'Box', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'BoxInterleaved', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'BoxTextured', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'BoxTexturedNonPowerOfTwo', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'Box With Spaces', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'BoxVertexColors', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'Duck', screenshot:'screenshot/screenshot.png', scale:1},
{category:'sampleModels', name:'2CylinderEngine', screenshot:'screenshot/screenshot.png', scale:0.005},
{category:'sampleModels', name:'ReciprocatingSaw', screenshot:'screenshot/screenshot.png', scale:0.01},
{category:'sampleModels', name:'GearboxAssy', screenshot:'screenshot/screenshot.png', scale:0.2},
{category:'sampleModels', name:'Buggy', screenshot:'screenshot/screenshot.png', scale:0.02},
{category:'sampleModels', name:'BoxAnimated', screenshot:'screenshot/screenshot.gif', scale:0.5},
{category:'sampleModels', name:'CesiumMilkTruck', screenshot:'screenshot/screenshot.gif', scale:0.5},
{category:'sampleModels', name:'RiggedSimple', screenshot:'screenshot/screenshot.gif', scale:0.2},
{category:'sampleModels', name:'RiggedFigure', screenshot:'screenshot/screenshot.gif', scale:1},
{category:'sampleModels', name:'CesiumMan', screenshot:'screenshot/screenshot.gif', scale:1},
{category:'sampleModels', name:'Fox', screenshot:'screenshot/screenshot.jpg', scale:0.02},
{category:'sampleModels', name:'BrainStem', screenshot:'screenshot/screenshot.gif', scale:1},
{category:'sampleModels', name:'VirtualCity', screenshot:'screenshot/screenshot.gif', scale:0.2},
];

ModelIndex.HasGifScreenshot = [ // List of only models that have *.gif screenshots (as opposed to *.png)
'BoxAnimated',
'BrainStem',
'CesiumMan',
'CesiumMilkTruck',
'RiggedFigure',
'RiggedSimple',
'VC'
];
//ModelIndex.HasGifScreenshot = [ // List of only models that have *.gif screenshots (as opposed to *.png)
// 'BoxAnimated',
// 'BrainStem',
// 'CesiumMan',
// 'CesiumMilkTruck',
// 'RiggedFigure',
// 'RiggedSimple',
// 'VirtualCity'
//];

ModelIndex.HasJpgScreenshot = [ // List of only models that have *.jpg screenshots
'Fox'
];
//ModelIndex.HasJpgScreenshot = [ // List of only models that have *.jpg screenshots
// 'Fox'
//];

//ModelIndex.getScreenshot = function(name) {
// let extension = ((ModelIndex.HasGifScreenshot.indexOf(name) < 0) ? 'png' : 'gif');
// if (ModelIndex.HasJpgScreenshot.indexOf(name) >= 0) extension = 'jpg';
// return name + '/screenshot/screenshot.' + extension;
//};

ModelIndex.getScreenshot = function(name) {
let extension = ((ModelIndex.HasGifScreenshot.indexOf(name) < 0) ? 'png' : 'gif');
if (ModelIndex.HasJpgScreenshot.indexOf(name) >= 0) extension = 'jpg';
return name + '/screenshot/screenshot.' + extension;
const model = this.List.find(model => model.name === name);
const defaultScreenshot = 'screenshot/screenshot.png';
return model ? `${name}/${model.screenshot || defaultScreenshot}` : `${name}/${defaultScreenshot}`;
};

ModelIndex.getModelInfoCollection = function() {
Expand Down
78 changes: 42 additions & 36 deletions tutorialModels/compare-pbr-model-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,52 @@
var TutorialComparePbrModelIndex = {};

TutorialComparePbrModelIndex.List = [
{category:'tutorialModels', name:'CompareAlphaCoverage', scale:2.0},
{category:'tutorialModels', name:'CompareAmbientOcclusion', scale:5.0},
{category:'tutorialModels', name:'CompareAnisotropy', scale:2.0},
{category:'tutorialModels', name:'CompareBaseColor', scale:2.0},
{category:'tutorialModels', name:'CompareClearcoat', scale:2.0},
{category:'tutorialModels', name:'CompareDispersion', scale:2.0},
{category:'tutorialModels', name:'CompareEmissiveStrength', scale:2.0},
{category:'tutorialModels', name:'CompareIor', scale:2.0},
{category:'tutorialModels', name:'CompareIridescence', scale:2.0},
{category:'tutorialModels', name:'CompareMetallic', scale:2.0},
{category:'tutorialModels', name:'CompareNormal', scale:2.0},
{category:'tutorialModels', name:'CompareRoughness', scale:2.0},
{category:'tutorialModels', name:'CompareSheen', scale:2.0},
{category:'tutorialModels', name:'CompareSpecular', scale:2.0},
{category:'tutorialModels', name:'CompareTransmission', scale:2.0},
{category:'tutorialModels', name:'CompareVolume', scale:2.0},
{category:'tutorialModels', name:'CompareAlphaCoverage', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareAmbientOcclusion', screenshot:'screenshot/screenshot.jpg', scale:5},
{category:'tutorialModels', name:'CompareAnisotropy', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareBaseColor', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareClearcoat', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareDispersion', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareEmissiveStrength', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareIor', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareIridescence', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareMetallic', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareNormal', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareRoughness', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareSheen', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareSpecular', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareTransmission', screenshot:'screenshot/screenshot.jpg', scale:2},
{category:'tutorialModels', name:'CompareVolume', screenshot:'screenshot/screenshot.jpg', scale:2},
];

TutorialComparePbrModelIndex.HasJpgScreenshot = [ // List of only models that have *.jpg screenshots
'CompareAlphaCoverage',
'CompareAmbientOcclusion',
'CompareAnisotropy',
'CompareBaseColor',
'CompareClearcoat',
'CompareDispersion',
'CompareEmissiveStrength',
'CompareIor',
'CompareIridescence',
'CompareMetallic',
'CompareNormal',
'CompareRoughness',
'CompareSheen',
'CompareSpecular',
'CompareTransmission',
'CompareVolume',
];
//TutorialComparePbrModelIndex.HasJpgScreenshot = [ // List of only models that have *.jpg screenshots
// 'CompareAlphaCoverage',
// 'CompareAmbientOcclusion',
// 'CompareAnisotropy',
// 'CompareBaseColor',
// 'CompareClearcoat',
// 'CompareDispersion',
// 'CompareEmissiveStrength',
// 'CompareIor',
// 'CompareIridescence',
// 'CompareMetallic',
// 'CompareNormal',
// 'CompareRoughness',
// 'CompareSheen',
// 'CompareSpecular',
// 'CompareTransmission',
// 'CompareVolume',
//];

//TutorialComparePbrModelIndex.getScreenshot = function(name) {
// let extension = ((TutorialComparePbrModelIndex.HasJpgScreenshot.indexOf(name) < 0) ? 'png' : 'jpg');
// return name + '/screenshot/screenshot.' + extension;
//};

TutorialComparePbrModelIndex.getScreenshot = function(name) {
let extension = ((TutorialComparePbrModelIndex.HasJpgScreenshot.indexOf(name) < 0) ? 'png' : 'jpg');
return name + '/screenshot/screenshot.' + extension;
const model = this.List.find(model => model.name === name);
const defaultScreenshot = 'screenshot/screenshot.png';
return model ? `${name}/${model.screenshot || defaultScreenshot}` : `${name}/${defaultScreenshot}`;
};

//TutorialComparePbrModelIndex.getEmbeddedFolderName = function(name) {
Expand Down
Loading

0 comments on commit 75e99b2

Please sign in to comment.