|
|
||
|---|---|---|
| .. | ||
| goldens | ||
| renderers/model-viewer | ||
| README.md | ||
| config.json | ||
| ic_modelviewer.svg | ||
| results-viewer.html | ||
README.md
Fidelity Testing
Crafting new test scenarios
As far as <model-viewer> is concerned, a scenario is just an HTML file that
incorporates <model-viewer> with a given configuration. This HTML file will
be loaded by a browser at test time and used to produce a screenshot for
comparison to any configured reference renders.
The steps to produce a new scenario are:
- Acquire or produce a glTF that is representative of what the scenario should
be testing.
- If applicable, also produce a corresponding USDZ of that model
- Pick a descriptive name for the scenario (for example,
alpha-blend-litmus) - Create a sub-directory of the
test/fidelityfolder with the same name as your scenario. This will be the scenario's directory. - Add any relevant screenshots of reference viewers to the scenario's
directory
- See above in this document for advice on creating reference viewer screenshots
- Add an
index.htmldocument containing a configured<model-viewer>, and with CSS margins removed from the<body>.- Currently, screenshots are taken in an area measured from the top-left of the document, so any margin will most likely lead to undesired results
- Modify the configuration at
test/fidelity/config.jsonto include an item underscenariosthat corresponds to your newly created scenario- Be sure to specify the dimensions of the test, the set of references (called "goldens") and the thresholds to test at (0, 1 and 10 are recommended).
On execution, a stringyfied scenario configuration will automatically be attached to args, the list of arguments to the executable. Please note the additional outputFile property.
Example configuration:
{
"scenario": {
"lighting": "../../../shared-assets/environments/lightroom_14b.hdr",
"dimensions": {
"width": 768,
"height": 450
},
"target": {
"x": 0,
"y": 0.3,
"z": 0
},
"orbit": {
"theta": 0,
"phi": 90,
"radius": 1
},
"verticalFoV": 45,
"renderSkybox": False,
"name": "khronos-SheenChair",
"model": "../../../shared-assets/models/glTF-Sample-Assets/Models/SheenChair/glTF-Binary/SheenChair.glb"
},
"outputFile": "./test/goldens/khronos-SheenChair/stellar-golden.png"
}