Skip to content
Open
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
30 changes: 30 additions & 0 deletions src/integrators/tests/test_adaptive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import drjit as dr
import mitsuba as mi
import pytest

def test_adaptive_sampling(variants_vec_rgb):
pytest.skip()
scene = mi.load_dict(mi.cornell_box())

adaptive_integrator = mi.load_dict({
'type': 'adaptive_sampling',
'threshold': 0.05,
'pass_spp': 16,
'nested': scene.integrator()
})

def callback(pass_i: int,
accum_spp: int,
pass_spp: int,
img: mi.TensorXf,
odd_img: mi.TensorXf,
error: mi.TensorXf,
active: mi.TensorXf):
print(f'Adaptive sampling pass {pass_i}, rendering {dr.count(active)} pixels with {pass_spp} spp.')
return True

adaptive_integrator.set_callback(callback)

img = mi.render(scene, integrator=adaptive_integrator, spp=512)
# img = mi.render(scene, integrator=scene.integrator(), spp=512)
# mi.Bitmap(img).write('output.exr')
1 change: 1 addition & 0 deletions src/python/python/ad/integrators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# List of submodules to import
submodules = [
'common',
'adaptive',
'prb_basic',
'prb',
'prbvolpath',
Expand Down
Loading