renderdiff: add transmission and ssao tests (#9232)

- 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
This commit is contained in:
Powei Feng
2025-10-16 23:17:07 -07:00
committed by GitHub
parent c379b31267
commit b6df2b9b35
5 changed files with 42 additions and 13 deletions

View File

@@ -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
@@ -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

View File

@@ -229,7 +229,7 @@ if __name__ == '__main__':
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)
@@ -237,7 +237,7 @@ if __name__ == '__main__':
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)

View File

@@ -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)

View File

@@ -1,12 +1,13 @@
AlphaBlendModeTest
AttenuationTest
Box
BoomBoxWithAxes
Box
BoxInterleaved
BoxTextured
BoxTexturedNonPowerOfTwo
Duck
IridescenceSuzanne
IridescentDishWithOlives
Lantern
MetalRoughSpheres
NegativeScaleTest
@@ -17,4 +18,5 @@ Sponza
Suzanne
TextureCoordinateTest
TextureSettingsTest
TransmissionRoughnessTest
TwoSidedPlane

View File

@@ -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"
},
@@ -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
}
}
]
}