2015-01-22 15:53:49 +05:00
|
|
|
#!/usr/bin/env python3
|
2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2015-2023 Blender Authors
|
2023-06-15 13:09:04 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2015-01-22 15:53:49 +05:00
|
|
|
|
|
|
|
import argparse
|
2024-07-16 09:46:12 +02:00
|
|
|
import platform
|
2015-01-22 15:53:49 +05:00
|
|
|
import os
|
2017-08-19 12:09:28 +02:00
|
|
|
import shlex
|
2015-01-22 15:53:49 +05:00
|
|
|
import sys
|
2020-08-05 12:59:28 +02:00
|
|
|
from pathlib import Path
|
2024-08-14 17:00:48 +02:00
|
|
|
from modules import render_report
|
2015-01-22 15:53:49 +05:00
|
|
|
|
2021-01-14 12:04:09 +01:00
|
|
|
# List of .blend files that are known to be failing and are not ready to be
|
|
|
|
# tested, or that only make sense on some devices. Accepts regular expressions.
|
2024-07-18 17:31:52 +02:00
|
|
|
BLOCKLIST_ALL = [
|
|
|
|
# Blocked due to overlapping object differences between platforms.
|
2022-01-26 18:37:20 +01:00
|
|
|
"hair_geom_reflection.blend",
|
|
|
|
"hair_geom_transmission.blend",
|
|
|
|
"hair_instancer_uv.blend",
|
|
|
|
"principled_hair_directcoloring.blend",
|
|
|
|
"visibility_particles.blend",
|
2025-02-06 14:53:16 +01:00
|
|
|
# Temporarily blocked for 4.4 lib upgrade, due to PNG alpha minor difference.
|
|
|
|
"image_log_osl.blend",
|
2022-01-26 18:37:20 +01:00
|
|
|
]
|
|
|
|
|
2025-06-03 14:46:32 +02:00
|
|
|
# Blocklist for device + build configuration that does not support OSL at all.
|
|
|
|
BLOCKLIST_OSL_NONE = [
|
2021-01-14 12:04:09 +01:00
|
|
|
'.*_osl.blend',
|
|
|
|
'osl_.*.blend',
|
|
|
|
]
|
|
|
|
|
2025-06-03 14:46:32 +02:00
|
|
|
# Blocklist for OSL with limited OSL tests for fast test execution.
|
|
|
|
BLOCKLIST_OSL_LIMITED = []
|
|
|
|
|
|
|
|
# Blocklist for tests that fail when running all tests with OSL backend.
|
|
|
|
# Most of these tests are blocked due to expected differences between SVM and OSL.
|
|
|
|
# Due to the expected differences there are usually a SVM and OSL version of the test.
|
|
|
|
# So blocking these tests doesn't lose any test permutations.
|
|
|
|
BLOCKLIST_OSL_ALL = BLOCKLIST_OSL_LIMITED + [
|
2024-08-14 17:00:48 +02:00
|
|
|
# AOVs are not supported. See 73266
|
|
|
|
'aov_position.blend',
|
|
|
|
'render_passes_aov.*.blend',
|
|
|
|
# Image sampling is different from SVM. There are OSL variants of these tests
|
|
|
|
'image_byte.*.blend',
|
|
|
|
'image_float.*.blend',
|
|
|
|
'image_half.*.blend',
|
|
|
|
'image_mapping_.*_closest.blend',
|
|
|
|
'image_mapping_.*_cubic.blend',
|
|
|
|
'image_mapping_.*_linear.blend',
|
|
|
|
'image_alpha_blend.blend',
|
|
|
|
'image_alpha_channel_packed.blend',
|
|
|
|
'image_alpha_ignore.blend',
|
|
|
|
'image_log.blend',
|
|
|
|
'image_non_color.blend',
|
|
|
|
'image_mapping_udim.blend',
|
2025-06-03 14:46:32 +02:00
|
|
|
# Tests that need investigating into why they're failing:
|
2024-08-14 17:00:48 +02:00
|
|
|
# Noise differences due to Principled BSDF mixing/layering used in some of these scenes
|
|
|
|
'render_passes_.*.blend',
|
|
|
|
]
|
|
|
|
|
2024-07-18 17:31:52 +02:00
|
|
|
BLOCKLIST_OPTIX = [
|
2021-10-19 15:02:44 +02:00
|
|
|
# Ray intersection precision issues
|
2025-02-01 09:04:31 +01:00
|
|
|
'big_triangles_50164.blend',
|
|
|
|
'big_plane_43865.blend',
|
2021-01-14 12:04:09 +01:00
|
|
|
]
|
|
|
|
|
2025-06-03 14:46:32 +02:00
|
|
|
# Blocklist for OSL tests that fail with the OptiX OSL backend.
|
|
|
|
BLOCKLIST_OPTIX_OSL_LIMITED = [
|
|
|
|
'image_.*_osl.blend',
|
|
|
|
# OptiX OSL doesn't support the trace function
|
|
|
|
'osl_trace_shader.blend',
|
|
|
|
]
|
|
|
|
|
|
|
|
# Blocklist for SVM tests that fail when forced to run with OptiX OSL
|
|
|
|
BLOCKLIST_OPTIX_OSL_ALL = BLOCKLIST_OPTIX_OSL_LIMITED + [
|
2025-04-15 09:20:09 +02:00
|
|
|
# OptiX OSL does support AO or Bevel
|
2024-08-14 17:00:48 +02:00
|
|
|
'ambient_occlusion.*.blend',
|
2025-04-15 09:20:09 +02:00
|
|
|
'bake_bevel.blend',
|
2024-08-14 17:00:48 +02:00
|
|
|
'bevel.blend',
|
2025-04-15 09:20:09 +02:00
|
|
|
'principled_bsdf_bevel_emission_137420.blend',
|
2024-12-17 06:48:38 +01:00
|
|
|
# The 3D texture doesn't have the right mappings
|
|
|
|
'point_density_.*_object.blend',
|
|
|
|
# Dicing tests use wireframe node which doesn't appear to be supported with OptiX OSL
|
|
|
|
'dicing_camera.blend',
|
|
|
|
'offscreen_dicing.blend',
|
|
|
|
'panorama_dicing.blend',
|
|
|
|
# The mapping of the UDIM texture is incorrect. Need to investigate why.
|
|
|
|
'image_mapping_udim_packed.blend',
|
|
|
|
# Error during rendering. Need to investigate why.
|
|
|
|
'points_volume.blend',
|
2024-08-14 17:00:48 +02:00
|
|
|
]
|
|
|
|
|
2024-12-17 06:48:38 +01:00
|
|
|
|
2024-07-18 17:31:52 +02:00
|
|
|
BLOCKLIST_METAL = []
|
2024-07-16 09:46:12 +02:00
|
|
|
|
|
|
|
if platform.system() == "Darwin":
|
|
|
|
version, _, _ = platform.mac_ver()
|
|
|
|
major_version = version.split(".")[0]
|
|
|
|
if int(major_version) < 13:
|
2024-07-18 17:31:52 +02:00
|
|
|
BLOCKLIST_METAL += [
|
2024-07-16 09:46:12 +02:00
|
|
|
# MNEE only works on Metal with macOS >= 13
|
|
|
|
"underwater_caustics.blend",
|
|
|
|
]
|
Cycles: approximate shadow caustics using manifold next event estimation
This adds support for selective rendering of caustics in shadows of refractive
objects. Example uses are rendering of underwater caustics and eye caustics.
This is based on "Manifold Next Event Estimation", a method developed for
production rendering. The idea is to selectively enable shadow caustics on a
few objects in the scene where they have a big visual impact, without impacting
render performance for the rest of the scene.
The Shadow Caustic option must be manually enabled on light, caustic receiver
and caster objects. For such light paths, the Filter Glossy option will be
ignored and replaced by sharp caustics.
Currently this method has a various limitations:
* Only caustics in shadows of refractive objects work, which means no caustics
from reflection or caustics that outside shadows. Only up to 4 refractive
caustic bounces are supported.
* Caustic caster objects should have smooth normals.
* Not currently support for Metal GPU rendering.
In the future this method may be extended for more general caustics.
TECHNICAL DETAILS
This code adds manifold next event estimation through refractive surface(s) as a
new sampling technique for direct lighting, i.e. finding the point on the
refractive surface(s) along the path to a light sample, which satisfies Fermat's
principle for a given microfacet normal and the path's end points. This
technique involves walking on the "specular manifold" using a pseudo newton
solver. Such a manifold is defined by the specular constraint matrix from the
manifold exploration framework [2]. For each refractive interface, this
constraint is defined by enforcing that the generalized half-vector projection
onto the interface local tangent plane is null. The newton solver guides the
walk by linearizing the manifold locally before reprojecting the linear solution
onto the refractive surface. See paper [1] for more details about the technique
itself and [3] for the half-vector light transport formulation, from which it is
derived.
[1] Manifold Next Event Estimation
Johannes Hanika, Marc Droske, and Luca Fascione. 2015.
Comput. Graph. Forum 34, 4 (July 2015), 87–97.
https://jo.dreggn.org/home/2015_mnee.pdf
[2] Manifold exploration: a Markov Chain Monte Carlo technique for rendering
scenes with difficult specular transport Wenzel Jakob and Steve Marschner.
2012. ACM Trans. Graph. 31, 4, Article 58 (July 2012), 13 pages.
https://www.cs.cornell.edu/projects/manifolds-sg12/
[3] The Natural-Constraint Representation of the Path Space for Efficient
Light Transport Simulation. Anton S. Kaplanyan, Johannes Hanika, and Carsten
Dachsbacher. 2014. ACM Trans. Graph. 33, 4, Article 102 (July 2014), 13 pages.
https://cg.ivd.kit.edu/english/HSLT.php
The code for this samping technique was inserted at the light sampling stage
(direct lighting). If the walk is successful, it turns off path regularization
using a specialized flag in the path state (PATH_MNEE_SUCCESS). This flag tells
the integrator not to blur the brdf roughness further down the path (in a child
ray created from BSDF sampling). In addition, using a cascading mechanism of
flag values, we cull connections to caustic lights for this and children rays,
which should be resolved through MNEE.
This mechanism also cancels the MIS bsdf counter part at the casutic receiver
depth, in essence leaving MNEE as the only sampling technique from receivers
through refractive casters to caustic lights. This choice might not be optimal
when the light gets large wrt to the receiver, though this is usually not when
you want to use MNEE.
This connection culling strategy removes a fair amount of fireflies, at the cost
of introducing a slight bias. Because of the selective nature of the culling
mechanism, reflective caustics still benefit from the native path
regularization, which further removes fireflies on other surfaces (bouncing
light off casters).
Differential Revision: https://developer.blender.org/D13533
2022-04-01 15:44:24 +02:00
|
|
|
|
2024-07-18 17:31:52 +02:00
|
|
|
BLOCKLIST_GPU = [
|
2021-01-14 12:04:09 +01:00
|
|
|
# Uninvestigated differences with GPU.
|
|
|
|
'image_log.blend',
|
2025-02-01 09:04:31 +01:00
|
|
|
'glass_mix_40964.blend',
|
|
|
|
'filter_glossy_refraction_45609.blend',
|
2021-01-14 12:04:09 +01:00
|
|
|
'smoke_color.blend',
|
|
|
|
'bevel_mblur.blend',
|
|
|
|
# Inconsistency between Embree and Hair primitive on GPU.
|
2021-10-19 15:02:44 +02:00
|
|
|
'denoise_hair.blend',
|
2021-01-14 12:04:09 +01:00
|
|
|
'hair_basemesh_intercept.blend',
|
|
|
|
'hair_instancer_uv.blend',
|
2025-04-17 16:10:33 +02:00
|
|
|
'hair_info.blend',
|
2021-01-14 12:04:09 +01:00
|
|
|
'hair_particle_random.blend',
|
2022-01-13 17:20:50 +01:00
|
|
|
"hair_transmission.blend",
|
2021-01-14 12:04:09 +01:00
|
|
|
'principled_hair_.*.blend',
|
|
|
|
'transparent_shadow_hair.*.blend',
|
2024-03-07 19:26:31 +01:00
|
|
|
"microfacet_hair_orientation.blend",
|
2022-01-13 17:20:50 +01:00
|
|
|
# Inconsistent handling of overlapping objects.
|
2025-02-01 09:04:31 +01:00
|
|
|
"sobol_uniform_41143.blend",
|
2022-01-13 17:20:50 +01:00
|
|
|
"visibility_particles.blend",
|
2022-09-21 17:58:34 +02:00
|
|
|
# No path guiding on GPU.
|
|
|
|
"guiding*.blend",
|
2021-01-14 12:04:09 +01:00
|
|
|
]
|
2015-01-22 15:53:49 +05:00
|
|
|
|
2021-07-06 12:05:27 +10:00
|
|
|
|
2024-08-14 17:00:48 +02:00
|
|
|
class CyclesReport(render_report.Report):
|
|
|
|
def __init__(self, title, output_dir, oiiotool, device=None, blocklist=[], osl=False):
|
2024-09-12 17:56:31 +02:00
|
|
|
# Split device name in format "<device_type>[-<RT>]" into individual
|
|
|
|
# tokens, setting the RT suffix to an empty string if its not specified.
|
2025-01-30 04:15:27 +01:00
|
|
|
self.device, suffix = (device.split("-") + [""])[:2]
|
2024-09-12 17:56:31 +02:00
|
|
|
self.use_hwrt = (suffix == "RT")
|
2024-08-14 17:00:48 +02:00
|
|
|
self.osl = osl
|
2025-02-03 04:16:27 +01:00
|
|
|
|
|
|
|
variation = self.device
|
|
|
|
if suffix:
|
|
|
|
variation += ' ' + suffix
|
2024-09-12 17:56:31 +02:00
|
|
|
if self.osl:
|
2025-02-03 04:16:27 +01:00
|
|
|
variation += ' OSL'
|
|
|
|
|
|
|
|
super().__init__(title, output_dir, oiiotool, variation, blocklist)
|
2024-08-14 17:00:48 +02:00
|
|
|
|
|
|
|
def _get_render_arguments(self, arguments_cb, filepath, base_output_filepath):
|
2024-09-12 17:56:31 +02:00
|
|
|
return arguments_cb(filepath, base_output_filepath, self.use_hwrt, self.osl)
|
2024-08-14 17:00:48 +02:00
|
|
|
|
2025-01-30 04:15:27 +01:00
|
|
|
def _get_arguments_suffix(self):
|
|
|
|
return ['--', '--cycles-device', self.device] if self.device else []
|
|
|
|
|
2024-09-12 13:01:34 -04:00
|
|
|
|
2024-09-12 17:56:31 +02:00
|
|
|
def get_arguments(filepath, output_filepath, use_hwrt=False, osl=False):
|
2019-05-16 15:48:30 +02:00
|
|
|
dirname = os.path.dirname(filepath)
|
|
|
|
basedir = os.path.dirname(dirname)
|
|
|
|
subject = os.path.basename(dirname)
|
|
|
|
|
2019-05-10 23:00:35 +02:00
|
|
|
args = [
|
|
|
|
"--background",
|
2019-05-16 15:48:30 +02:00
|
|
|
"--factory-startup",
|
|
|
|
"--enable-autoexec",
|
2020-08-26 22:02:02 +02:00
|
|
|
"--debug-memory",
|
|
|
|
"--debug-exit-on-error",
|
2019-05-16 15:48:30 +02:00
|
|
|
filepath,
|
|
|
|
"-E", "CYCLES",
|
|
|
|
"-o", output_filepath,
|
|
|
|
"-F", "PNG"]
|
2017-08-19 12:09:28 +02:00
|
|
|
|
|
|
|
# OSL and GPU examples
|
|
|
|
# custom_args += ["--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True"]
|
|
|
|
# custom_args += ["--python-expr", "import bpy; bpy.context.scene.cycles.device = 'GPU'"]
|
2019-02-11 18:26:47 +01:00
|
|
|
custom_args = os.getenv('CYCLESTEST_ARGS')
|
2019-05-10 23:00:35 +02:00
|
|
|
if custom_args:
|
|
|
|
args.extend(shlex.split(custom_args))
|
2019-05-16 15:48:30 +02:00
|
|
|
|
2023-01-24 17:02:25 +01:00
|
|
|
spp_multiplier = os.getenv('CYCLESTEST_SPP_MULTIPLIER')
|
|
|
|
if spp_multiplier:
|
|
|
|
args.extend(["--python-expr", f"import bpy; bpy.context.scene.cycles.samples *= {spp_multiplier}"])
|
|
|
|
|
2024-09-12 17:56:31 +02:00
|
|
|
cycles_pref = "bpy.context.preferences.addons['cycles'].preferences"
|
|
|
|
use_hwrt_bool_value = "True" if use_hwrt else "False"
|
|
|
|
use_hwrt_on_off_value = "'ON'" if use_hwrt else "'OFF'"
|
|
|
|
args.extend([
|
|
|
|
"--python-expr",
|
|
|
|
(f"import bpy;"
|
|
|
|
f"{cycles_pref}.use_hiprt = {use_hwrt_bool_value};"
|
|
|
|
f"{cycles_pref}.use_oneapirt = {use_hwrt_bool_value};"
|
|
|
|
f"{cycles_pref}.metalrt = {use_hwrt_on_off_value}")
|
|
|
|
])
|
|
|
|
|
2024-08-14 17:00:48 +02:00
|
|
|
if osl:
|
|
|
|
args.extend(["--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True"])
|
|
|
|
|
2019-05-10 23:00:35 +02:00
|
|
|
if subject == 'bake':
|
|
|
|
args.extend(['--python', os.path.join(basedir, "util", "render_bake.py")])
|
2019-05-16 15:48:30 +02:00
|
|
|
elif subject == 'denoise_animation':
|
2019-05-10 23:00:35 +02:00
|
|
|
args.extend(['--python', os.path.join(basedir, "util", "render_denoise.py")])
|
2019-05-16 15:48:30 +02:00
|
|
|
else:
|
2019-05-10 23:00:35 +02:00
|
|
|
args.extend(["-f", "1"])
|
2015-01-22 15:53:49 +05:00
|
|
|
|
2019-05-10 23:00:35 +02:00
|
|
|
return args
|
2015-01-22 15:53:49 +05:00
|
|
|
|
2020-10-02 10:10:01 +10:00
|
|
|
|
2015-01-22 15:53:49 +05:00
|
|
|
def create_argparse():
|
2024-12-10 14:52:34 +01:00
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
description="Run test script for each blend file in TESTDIR, comparing the render result with known output."
|
|
|
|
)
|
|
|
|
parser.add_argument("--blender", required=True)
|
|
|
|
parser.add_argument("--testdir", required=True)
|
|
|
|
parser.add_argument("--outdir", required=True)
|
|
|
|
parser.add_argument("--oiiotool", required=True)
|
|
|
|
parser.add_argument("--device", required=True)
|
2025-06-03 14:46:32 +02:00
|
|
|
parser.add_argument("--osl", default='none', type=str, choices=["none", "limited", "all"])
|
2023-11-08 18:41:33 +01:00
|
|
|
parser.add_argument('--batch', default=False, action='store_true')
|
2015-01-22 15:53:49 +05:00
|
|
|
return parser
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
parser = create_argparse()
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2024-12-10 14:52:34 +01:00
|
|
|
device = args.device
|
2015-01-22 15:53:49 +05:00
|
|
|
|
2024-07-18 17:31:52 +02:00
|
|
|
blocklist = BLOCKLIST_ALL
|
2025-06-03 14:46:32 +02:00
|
|
|
|
|
|
|
if args.osl == 'none':
|
|
|
|
blocklist += BLOCKLIST_OSL_NONE
|
|
|
|
elif args.osl == "limited":
|
|
|
|
blocklist += BLOCKLIST_OSL_LIMITED
|
|
|
|
else:
|
|
|
|
blocklist += BLOCKLIST_OSL_ALL
|
|
|
|
|
2021-01-14 12:04:09 +01:00
|
|
|
if device != 'CPU':
|
2024-07-18 17:31:52 +02:00
|
|
|
blocklist += BLOCKLIST_GPU
|
2025-06-03 14:46:32 +02:00
|
|
|
|
2021-01-14 12:04:09 +01:00
|
|
|
if device == 'OPTIX':
|
2024-08-07 11:46:58 +02:00
|
|
|
blocklist += BLOCKLIST_OPTIX
|
2025-06-03 14:46:32 +02:00
|
|
|
if args.osl == 'limited':
|
|
|
|
blocklist += BLOCKLIST_OPTIX_OSL_LIMITED
|
|
|
|
elif args.osl == 'all':
|
|
|
|
blocklist += BLOCKLIST_OPTIX_OSL_ALL
|
Cycles: approximate shadow caustics using manifold next event estimation
This adds support for selective rendering of caustics in shadows of refractive
objects. Example uses are rendering of underwater caustics and eye caustics.
This is based on "Manifold Next Event Estimation", a method developed for
production rendering. The idea is to selectively enable shadow caustics on a
few objects in the scene where they have a big visual impact, without impacting
render performance for the rest of the scene.
The Shadow Caustic option must be manually enabled on light, caustic receiver
and caster objects. For such light paths, the Filter Glossy option will be
ignored and replaced by sharp caustics.
Currently this method has a various limitations:
* Only caustics in shadows of refractive objects work, which means no caustics
from reflection or caustics that outside shadows. Only up to 4 refractive
caustic bounces are supported.
* Caustic caster objects should have smooth normals.
* Not currently support for Metal GPU rendering.
In the future this method may be extended for more general caustics.
TECHNICAL DETAILS
This code adds manifold next event estimation through refractive surface(s) as a
new sampling technique for direct lighting, i.e. finding the point on the
refractive surface(s) along the path to a light sample, which satisfies Fermat's
principle for a given microfacet normal and the path's end points. This
technique involves walking on the "specular manifold" using a pseudo newton
solver. Such a manifold is defined by the specular constraint matrix from the
manifold exploration framework [2]. For each refractive interface, this
constraint is defined by enforcing that the generalized half-vector projection
onto the interface local tangent plane is null. The newton solver guides the
walk by linearizing the manifold locally before reprojecting the linear solution
onto the refractive surface. See paper [1] for more details about the technique
itself and [3] for the half-vector light transport formulation, from which it is
derived.
[1] Manifold Next Event Estimation
Johannes Hanika, Marc Droske, and Luca Fascione. 2015.
Comput. Graph. Forum 34, 4 (July 2015), 87–97.
https://jo.dreggn.org/home/2015_mnee.pdf
[2] Manifold exploration: a Markov Chain Monte Carlo technique for rendering
scenes with difficult specular transport Wenzel Jakob and Steve Marschner.
2012. ACM Trans. Graph. 31, 4, Article 58 (July 2012), 13 pages.
https://www.cs.cornell.edu/projects/manifolds-sg12/
[3] The Natural-Constraint Representation of the Path Space for Efficient
Light Transport Simulation. Anton S. Kaplanyan, Johannes Hanika, and Carsten
Dachsbacher. 2014. ACM Trans. Graph. 33, 4, Article 102 (July 2014), 13 pages.
https://cg.ivd.kit.edu/english/HSLT.php
The code for this samping technique was inserted at the light sampling stage
(direct lighting). If the walk is successful, it turns off path regularization
using a specialized flag in the path state (PATH_MNEE_SUCCESS). This flag tells
the integrator not to blur the brdf roughness further down the path (in a child
ray created from BSDF sampling). In addition, using a cascading mechanism of
flag values, we cull connections to caustic lights for this and children rays,
which should be resolved through MNEE.
This mechanism also cancels the MIS bsdf counter part at the casutic receiver
depth, in essence leaving MNEE as the only sampling technique from receivers
through refractive casters to caustic lights. This choice might not be optimal
when the light gets large wrt to the receiver, though this is usually not when
you want to use MNEE.
This connection culling strategy removes a fair amount of fireflies, at the cost
of introducing a slight bias. Because of the selective nature of the culling
mechanism, reflective caustics still benefit from the native path
regularization, which further removes fireflies on other surfaces (bouncing
light off casters).
Differential Revision: https://developer.blender.org/D13533
2022-04-01 15:44:24 +02:00
|
|
|
if device == 'METAL':
|
2024-07-18 17:31:52 +02:00
|
|
|
blocklist += BLOCKLIST_METAL
|
2021-01-14 12:04:09 +01:00
|
|
|
|
2025-06-03 14:46:32 +02:00
|
|
|
report = CyclesReport('Cycles', args.outdir, args.oiiotool, device, blocklist, args.osl == 'all')
|
2018-02-14 17:33:06 +01:00
|
|
|
report.set_pixelated(True)
|
2019-05-06 19:46:32 +02:00
|
|
|
report.set_reference_dir("cycles_renders")
|
2020-10-28 16:19:03 +01:00
|
|
|
if device == 'CPU':
|
|
|
|
report.set_compare_engine('eevee')
|
|
|
|
else:
|
|
|
|
report.set_compare_engine('cycles', 'CPU')
|
2020-08-05 11:20:25 +02:00
|
|
|
|
2023-02-12 14:37:16 +11:00
|
|
|
# Increase threshold for motion blur, see #78777.
|
2023-05-19 16:42:08 +02:00
|
|
|
#
|
|
|
|
# underwater_caustics.blend gives quite different results on Linux and Intel macOS compared to
|
|
|
|
# Windows and Arm macOS.
|
2024-08-14 17:00:48 +02:00
|
|
|
#
|
|
|
|
# OSL tests:
|
|
|
|
# Blackbody is slightly different between SVM and OSL.
|
|
|
|
# Microfacet hair renders slightly differently, and fails on Windows and Linux with OSL
|
2025-03-09 03:59:40 +01:00
|
|
|
#
|
|
|
|
# both_displacement.blend has slight differences between Linux and other platforms.
|
2024-08-14 17:00:48 +02:00
|
|
|
|
2024-12-10 14:52:34 +01:00
|
|
|
test_dir_name = Path(args.testdir).name
|
2025-03-09 03:59:40 +01:00
|
|
|
if (test_dir_name in {'motion_blur', 'integrator', "displacement"}) or \
|
2025-06-03 14:46:32 +02:00
|
|
|
((args.osl == 'all') and (test_dir_name in {'shader', 'hair'})):
|
2020-08-05 11:20:25 +02:00
|
|
|
report.set_fail_threshold(0.032)
|
|
|
|
|
2025-01-25 01:57:03 +01:00
|
|
|
# Layer mixing is different between SVM and OSL, so a few tests have
|
|
|
|
# noticably different noise causing OSL Principled BSDF tests to fail.
|
2025-06-03 14:46:32 +02:00
|
|
|
if ((args.osl == 'all') and (test_dir_name == 'principled_bsdf')):
|
2025-01-25 01:57:03 +01:00
|
|
|
report.set_fail_threshold(0.06)
|
|
|
|
|
2024-12-10 14:52:34 +01:00
|
|
|
ok = report.run(args.testdir, args.blender, get_arguments, batch=args.batch)
|
2015-01-22 15:53:49 +05:00
|
|
|
|
|
|
|
sys.exit(not ok)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|