Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/renderdiff/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rendering Difference Test

We created a few scripts to run `gltf_viewer` and produce headless renderings.
This tool is a collections of scripts to run `gltf_viewer` and produce headless renderings.

This is mainly useful for continuous integration where GPUs are generally not available on cloud
machines. To perform software rasterization, these scripts are centered around [Mesa]'s
Expand All @@ -9,10 +9,10 @@ Additionally, we should be able to use GPUs where available (though this is more
work).

The script `render.py` contains the core logic for taking input parameters (such as the test
description file) and then running gltf_viewer to produce the renderings.
description file) and then running `gltf_viewer` to produce the renderings.

In the `test` directory is a list of test descriptions that are specified in json. Please see
`sample.json` to parse the structure.
`sample.json` to glean the structure.

## Setting up python

Expand Down
4 changes: 2 additions & 2 deletions test/renderdiff/src/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ def single_test(src_dir, dest_dir, src_fname):
important_print(f'Successfully compared {success_count} / {len(results)} images')

if tolerance_used_details:
pstr = 'Tolerance-based passes:'
pstr = 'Passed:'
for detail in tolerance_used_details:
pstr += '\n' + detail
important_print(pstr)

if failed_details:
pstr = 'Failed:'
for detail in failed_details:
pstr = '\n' + detail
pstr += '\n' + detail
important_print(pstr)
if len(failed) > 0:
exit(1)
2 changes: 1 addition & 1 deletion test/renderdiff/src/update_golden.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _get_deletes_updates(update_dir, golden_dir):
for fpath in base.intersection(new):
base_fpath = os.path.join(golden_dir, fpath)
new_fpath = os.path.join(update_dir, fpath)
if (ext == 'tif' and not same_image(new_fpath, base_fpath)) or \
if (ext == 'tif' and not same_image(new_fpath, base_fpath)[0]) or \
(ext == 'json' and _file_as_str(new_fpath) != _file_as_str(base_fpath)):
update.append(fpath)

Expand Down
4 changes: 3 additions & 1 deletion test/renderdiff/tests/gltf_models.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
AlphaBlendModeTest
AttenuationTest
Box
BoomBoxWithAxes
Box
BoxInterleaved
BoxTextured
BoxTexturedNonPowerOfTwo
Duck
IridescenceSuzanne
IridescentDishWithOlives
Lantern
MetalRoughSpheres
NegativeScaleTest
Expand All @@ -17,4 +18,5 @@ Sponza
Suzanne
TextureCoordinateTest
TextureSettingsTest
TransmissionRoughnessTest
TwoSidedPlane
39 changes: 33 additions & 6 deletions test/renderdiff/tests/presubmit.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"presets": [
{
"name": "base",
"models": ["Box", "BoxTextured", "Duck", "lucy", "FlightHelmet"],
"models": ["Box", "BoxTextured", "FlightHelmet", "lucy"],
"rendering": {
"viewer.cameraFocusDistance": 0,
"viewer.cameraFocalLength": 35.0,
"view.postProcessingEnabled": true,
"view.dithering": "NONE"
},
Expand All @@ -17,27 +17,54 @@
}
},
{
"name": "helmet_only",
"name": "bloom_models",
"models": ["DamagedHelmet"],
"rendering": {}
},
{
"name": "ssao_models",
"models": ["Duck", "lucy"],
"rendering": {}
},
{
"name": "transmission_models",
"models": ["TransmissionRoughnessTest", "IridescentDishWithOlives"],
"rendering": {}
}
],
"tests": [
{
"name": "Bloom",
"description": "Testing bloom",
"apply_presets": ["base", "helmet_only"],
"description": "Bloom",
"apply_presets": ["base", "bloom_models"],
"rendering": {
"view.bloom.enabled": true
}
},
{
"name": "MSAA",
"description": "Testing multisampling anti-aliasing",
"description": "Multisampling anti-aliasing",
"apply_presets": ["base"],
"rendering": {
"view.msaa.enabled": true
}
},
{
"name": "Transimssion",
"description": "transmission",
"apply_presets": ["base", "transmission_models"],
"rendering": {
"viewer.cameraFocalLength": 52.0,
"view.screenSpaceReflections.enabled": true
}
},
{
"name": "SSAO",
"description": "Screen space ambient occulsion",
"apply_presets": ["base", "ssao_models"],
"rendering": {
"view.ssao.enabled": true
}
}
]
}
Loading