-
According to the documentation, the area light of mitsuba 3 the radiance parameter supports spectrum and no texture. In mitsuba 2 I could optimize the texture of the area light. Looking in the source code of the mitsuba 3 area light I could not comprehend why it is not possible to pass a texture as parameter. Internally the reflectance parameter has texture type and the When trying to use the bitmap plugin together with the radiance parameter, the rendering call crashes on my system with "Critical Dr.Jit compiler failure: jit_var(r0): unknown variable!". As I would like to use mitsuba 3 to optimize the texture of an area light (together with the position of a spherical mirror), I was wondering why this happens and if there is a simple solution to this problem. If the issue is not known, I am happy to provide a complete example (containing the meshes) and create an issue. My code looks as follows: import drjit as dr
import mitsuba as mi
mi.set_variant('cuda_ad_rgb') #mi.set_variant('llvm_ad_rgb')
from mitsuba.scalar_rgb import Transform4f as T
emitter_size = .6
emitter_z_transform = 1
emitter_to_world = T.scale([emitter_size,emitter_size,1]) @ T.look_at(origin=[0, 0, emitter_z_transform],
target=[0, 0, 0],
up=[0, 1, 0])
sensor_z_transform = .2
optimization_iterations = 10
# spatially varying illumination texture
emitterarray = dr.ones(mi.TensorXf, (256, 128, 3)) * 10
scene = mi.load_dict({
'type': 'scene',
'integrator': {
'type': 'direct_reparam',
},
'sensor': {
'type': 'perspective',
'to_world': T.look_at(origin=[0, 0, sensor_z_transform],
target=[0, 0, 0],
up=[0, 1, 0]),
'fov': 60,
'film': {
'type': 'hdrfilm',
'width': 64,
'height': 64,
'rfilter': { 'type': 'gaussian' },
'sample_border': True
},
},
'wall': {
'type': 'rectangle',
'to_world': T.translate([0, 0, -1]).scale(.6),
'bsdf': {
'type': 'diffuse',
'reflectance': { 'type': 'rgb', 'value': (1, 0.1, 0.1) },
}
},
'calibration_sphere': {
'type': 'ply',
'filename': 'sphere.ply',
'to_world': T.scale(1),
'bsdf': {
'type': 'conductor',
'material': 'Cr'
},
},
'light': {
'type' : 'ply',
'to_world': T.scale([emitter_size,emitter_size,1]) @ T.look_at(origin=[0, 0, emitter_z_transform],
target=[0, 0, 0],
up=[0, 1, 0]),
'filename': 'emitter.ply',
'emitter': {
'type': 'area',
'radiance': {
'type': 'bitmap',
'raw': True,
'bitmap': mi.Bitmap(emitterarray),
'filter_type': 'bilinear'
}
}
}
})
img_ref = mi.render(scene, seed=0, spp=20) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Moved to #322 |
Beta Was this translation helpful? Give feedback.
Moved to #322