-
Not sure if this is a bug or not, and it is probably related to this and this. I wrote a script (see below) that tests an Combination | RGB Irradiance, spp: 1048576
area path | 0.63, 0.63, 0.63
area ptracer | 2.76, 2.76, 2.76
directional path | 0.00, 0.00, 0.00
directional ptracer | 0.00, 0.00, 0.00 The What I don't understand is why both integrators compute different measurments for the import mitsuba as mi
mi.set_variant("scalar_rgb")
area_emitter = {
'type': 'rectangle',
'to_world': mi.ScalarTransform4f().look_at([0, 0, 1], [0,0,0], [0,1,0]).scale(0.5), # -Z normal, unit area
'emitter': {
'type': 'area',
'radiance': {
'type': 'rgb',
'value': 1.0,
}
}
}
directional_emitter = {
'type': 'directional',
'direction': [0, 0, -1],
'irradiance': {
'type': 'rgb',
'value': 1.0,
}
}
path_integrator = {
'type': 'path',
}
ptracer_integrator = {
'type': 'ptracer',
'samples_per_pass': 32
}
make_scene = lambda integrator, emitter, spp: {
'type': 'scene',
'integrator': integrator,
'rect': {
'type': 'rectangle',
'to_world': mi.ScalarTransform4f().look_at([0,0,0], [0,0,1], [0,1,0]).scale(0.5), # +Z normal, unit area
'material': {
'type': 'diffuse',
'reflectance': {
'type': 'rgb',
'value': [1, 1, 1]
}
},
'sensor': {
'type': 'irradiancemeter',
'sampler': {
'type': 'independent',
'sample_count': spp,
},
'film': {
'type': 'hdrfilm',
'width': 1,
'height': 1,
'rfilter': {
'type': 'box',
},
'pixel_format': 'rgb',
},
},
},
'emitter': emitter,
}
spp = 1024**2
combinations = [
('path-area', path_integrator, area_emitter),
('ptracer-area', ptracer_integrator, area_emitter),
('path-directional', path_integrator, directional_emitter),
('ptracer-directional', ptracer_integrator, directional_emitter),
]
irradiance = []
for (label, integrator, emitter) in combinations:
scene_dict = make_scene(integrator, emitter, spp)
scene = mi.load_dict(scene_dict)
img = mi.render(scene, spp=spp)
irradiance.append((label, img.array))
# print results
column1 = 'Combination'; column2 = f'RGB Irradiance, spp: {spp}'; width = 50
print('-'*width)
print(f'{column1:19} | {column2:28}')
print('-'*width)
for label, irr in irradiance:
integrator, emitter = label.split('-')
rgb_values = ','.join([f'{v:9.2f}' for v in irr])
print(f'{emitter:11} {integrator:7} |{rgb_values}') |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @cfreude, I'll provide a partial answer, to be confirmed / corrected / extended by the dev team. As mentioned in one of the comments you're referring to, the |
Beta Was this translation helpful? Give feedback.
Hi @cfreude, I'll provide a partial answer, to be confirmed / corrected / extended by the dev team.
As mentioned in one of the comments you're referring to, the
path
integrator does not connect visible delta emitters to the sensor: getting a 0 value with adirectional
emitter is expected. If I understood theptracer
code correctly, it doesn't connect visible delta emitters to the sensor either, nor does it accumulate radiance contributions when the path tracing routine hits a "physical" sensor. I'd therefore also expect a 0 value with adirectional
emitter directly illuminating a surface.