Skip to content

Commit

Permalink
fix logic for steady state renders
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoroyo committed Apr 8, 2024
1 parent 997df8f commit 6b75dce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from tal.config import set_resources, ResourcesConfig as resources
from tal.log import set_log_level, LogLevel

__version__ = '0.16.0'
__version__ = '0.16.1'
28 changes: 16 additions & 12 deletions tal/render/mitsuba3_transient_nlos.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,22 +450,26 @@ def run_mitsuba(scene_xml_path, hdr_path, defines,
else:
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'

laser_lookat_x = defines.pop('laser_lookat_x')
laser_lookat_y = defines.pop('laser_lookat_y')
focus_laser = False
if 'laser_lookat_x' in defines and 'laser_lookat_y' in defines:
focus_laser = True
laser_lookat_x = defines.pop('laser_lookat_x')
laser_lookat_y = defines.pop('laser_lookat_y')

scene = mi.load_file(scene_xml_path, **defines)
integrator = scene.integrator()
mitr.utils.set_thread_count(args.threads)

def find_id(array, eid):
same_id = list(filter(lambda e: e.id() == eid, array))
assert len(same_id) == 1, f'Expected 1 element with id {eid}'
return same_id[0]

mitr.nlos.focus_emitter_at_relay_wall_pixel(
mi.Point2f(laser_lookat_x, laser_lookat_y),
find_id(scene.shapes(), 'relay_wall'),
find_id(scene.emitters(), 'laser'))
if focus_laser:
def find_id(array, eid):
same_id = list(filter(lambda e: e.id() == eid, array))
assert len(same_id) == 1, f'Expected 1 element with id {eid}'
return same_id[0]

mitr.utils.set_thread_count(args.threads)
mitr.nlos.focus_emitter_at_relay_wall_pixel(
mi.Point2f(laser_lookat_x, laser_lookat_y),
find_id(scene.shapes(), 'relay_wall'),
find_id(scene.emitters(), 'laser'))

# prepare
if isinstance(integrator, TransientADIntegrator):
Expand Down

0 comments on commit 6b75dce

Please sign in to comment.