Skip to content

Commit c37175a

Browse files
committed
renderdiff: add transmission and ssao tests
- Add transmission and ssao tests - Small mods to README.md - Add transmission models to gltf list - Change focal length to zoom in for more details RDIFF_BRANCH=pf/renderdiff-add-transmission
1 parent c379b31 commit c37175a

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

test/renderdiff/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rendering Difference Test
22

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

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

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

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

1717
## Setting up python
1818

test/renderdiff/src/compare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ def single_test(src_dir, dest_dir, src_fname):
229229
important_print(f'Successfully compared {success_count} / {len(results)} images')
230230

231231
if tolerance_used_details:
232-
pstr = 'Tolerance-based passes:'
232+
pstr = 'Passed:'
233233
for detail in tolerance_used_details:
234234
pstr += '\n' + detail
235235
important_print(pstr)
236236

237237
if failed_details:
238238
pstr = 'Failed:'
239239
for detail in failed_details:
240-
pstr = '\n' + detail
240+
pstr += '\n' + detail
241241
important_print(pstr)
242242
if len(failed) > 0:
243243
exit(1)

test/renderdiff/src/update_golden.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _get_deletes_updates(update_dir, golden_dir):
7474
for fpath in base.intersection(new):
7575
base_fpath = os.path.join(golden_dir, fpath)
7676
new_fpath = os.path.join(update_dir, fpath)
77-
if (ext == 'tif' and not same_image(new_fpath, base_fpath)) or \
77+
if (ext == 'tif' and not same_image(new_fpath, base_fpath)[0]) or \
7878
(ext == 'json' and _file_as_str(new_fpath) != _file_as_str(base_fpath)):
7979
update.append(fpath)
8080

test/renderdiff/tests/gltf_models.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
AlphaBlendModeTest
22
AttenuationTest
3-
Box
43
BoomBoxWithAxes
4+
Box
55
BoxInterleaved
66
BoxTextured
77
BoxTexturedNonPowerOfTwo
88
Duck
99
IridescenceSuzanne
10+
IridescentDishWithOlives
1011
Lantern
1112
MetalRoughSpheres
1213
NegativeScaleTest
@@ -17,4 +18,5 @@ Sponza
1718
Suzanne
1819
TextureCoordinateTest
1920
TextureSettingsTest
21+
TransmissionRoughnessTest
2022
TwoSidedPlane

test/renderdiff/tests/presubmit.json

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"presets": [
66
{
77
"name": "base",
8-
"models": ["Box", "BoxTextured", "Duck", "lucy", "FlightHelmet"],
8+
"models": ["Box", "BoxTextured", "FlightHelmet", "lucy"],
99
"rendering": {
10-
"viewer.cameraFocusDistance": 0,
10+
"viewer.cameraFocalLength": 35.0,
1111
"view.postProcessingEnabled": true,
1212
"view.dithering": "NONE"
1313
},
@@ -17,27 +17,54 @@
1717
}
1818
},
1919
{
20-
"name": "helmet_only",
20+
"name": "bloom_models",
2121
"models": ["DamagedHelmet"],
2222
"rendering": {}
23+
},
24+
{
25+
"name": "ssao_models",
26+
"models": ["Duck", "lucy"],
27+
"rendering": {}
28+
},
29+
{
30+
"name": "transmission_models",
31+
"models": ["TransmissionRoughnessTest", "IridescentDishWithOlives"],
32+
"rendering": {}
2333
}
2434
],
2535
"tests": [
2636
{
2737
"name": "Bloom",
28-
"description": "Testing bloom",
29-
"apply_presets": ["base", "helmet_only"],
38+
"description": "Bloom",
39+
"apply_presets": ["base", "bloom_models"],
3040
"rendering": {
3141
"view.bloom.enabled": true
3242
}
3343
},
3444
{
3545
"name": "MSAA",
36-
"description": "Testing multisampling anti-aliasing",
46+
"description": "Multisampling anti-aliasing",
3747
"apply_presets": ["base"],
3848
"rendering": {
3949
"view.msaa.enabled": true
4050
}
51+
},
52+
{
53+
"name": "Transimssion",
54+
"description": "transmission",
55+
"apply_presets": ["base", "transmission_models"],
56+
"rendering": {
57+
"viewer.cameraFocalLength": 52.0,
58+
"view.screenSpaceReflections.enabled": true
59+
}
60+
},
61+
{
62+
"name": "SSAO",
63+
"description": "Screen space ambient occulsion",
64+
"apply_presets": ["base", "ssao_models"],
65+
"rendering": {
66+
"view.ssao.enabled": true
67+
}
4168
}
4269
]
4370
}

0 commit comments

Comments
 (0)