Skip to content

Commit

Permalink
wip: all functionality is imported, still plenty of errors to fix
Browse files Browse the repository at this point in the history
I've left a sample NLOS scene in test/z-scene-properties,
the correct result that should come out can be found in
diegoroyo/tal#1
  • Loading branch information
diegoroyo committed Mar 3, 2023
1 parent 4b70f53 commit 4f2fc25
Show file tree
Hide file tree
Showing 15 changed files with 961 additions and 544 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
notebooks/transientFrames/**

.vscode
test
test/*
!test/z-scene-properties

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
21 changes: 0 additions & 21 deletions mitransient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
"""
TODO(diego):
- Import mitsuba, if it's not available then raise an exception
telling the user to source the setpath.sh of the mitsuba installation
or to install mitsuba using pip.
- Ensure that mitransient has autocompletion with the same attributes as mitsuba
Needs testing: set the __all__ or __dict__ variables to equal mitsuba's
__all__ or __dict__ variables, but make sure that our own functions
overwrite Mitsuba's (e.g. our sensor class)
- Check other files' __init__.py files to see if their contents can be moved
to the same function
"""


try:
import mitsuba
except ModuleNotFoundError:
raise Exception(
'The mitsuba installation could not be found. '
'Please install it using pip or source the setpath.sh file of your Mitsuba installation.')

from .integrators import *
from .render import *
from .sensors import *
Expand Down
29 changes: 16 additions & 13 deletions mitransient/integrators/common.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
"""
TODO(diego): Figure out how to handle large numbers of samples per pixel
so that the progress bar updates more frequently
(similar to mitsuba2-transient-nlos's multiple passes)
"""

# Delayed parsing of type annotations
from __future__ import annotations as __annotations__

Expand Down Expand Up @@ -33,25 +27,35 @@ class TransientADIntegrator(ADIntegrator):
1, then path generation many randomly cease after encountering directly
visible surfaces. (Default: 5)
"""
# TODO: Add documentation for other parameters
# FIXME: Add documentation for other parameters
# note that temporal bins, exposure, initial time are measured in optical path length

def __init__(self, props=mi.Properties()):
super().__init__(props)

# imported: max_depth and rr_depth

# FIXME(diego): set these values in the XML file
# self.transient_block = None
# self.temporal_bins = props.get('temporal_bins', 128)
# self.exposure = props.get('exposure', 3.5)
# self.initial_time = props.get('initial_time', 0)
# self.camera_unwarp = props.get('camera_unwarp', False)
# self.temporal_filter = props.get('temporal_filter', '')
# self.gaussian_stddev = props.get('gaussian_stddev', 2.0)
# self.progressive = props.get('progressive', 0.0)

self.transient_block = None
self.temporal_bins = props.get('temporal_bins', 128)
self.exposure = props.get('exposure', 3.5)
self.temporal_bins = props.get('temporal_bins', 2048)
self.exposure = props.get('exposure', 0.003)
self.initial_time = props.get('initial_time', 0)
self.camera_unwarp = props.get('camera_unwarp', False)
self.temporal_filter = props.get('temporal_filter', '')
self.gaussian_stddev = props.get('gaussian_stddev', 2.0)
self.progressive = props.get('progressive', 0.0)

def to_string(self):
# TODO add other parameters
# FIXME add other parameters
return f'{type(self).__name__}[max_depth = {self.max_depth},' \
f' rr_depth = { self.rr_depth }]'

Expand Down Expand Up @@ -565,7 +569,7 @@ def sample(self,
This mask array can optionally be used to indicate that some of
the rays are disabled.
TODO(diego): Parameter ``add_transient_f`` (and document type above)
FIXME(diego): Parameter ``add_transient_f`` (and document type above)
or probably refer to non-transient RB
The function returns a tuple ``(spec, valid, state_out)`` where
Expand All @@ -583,8 +587,7 @@ def sample(self,
'It should be implemented by subclasses that '
'specialize the abstract RBIntegrator interface.')

# Prioritizes RBIntegrator functions over TransientADIntegrator


class TransientRBIntegrator(RBIntegrator, TransientADIntegrator):
# Prioritizes RBIntegrator functions over TransientADIntegrator
pass
158 changes: 102 additions & 56 deletions mitransient/integrators/transient_prb_volpath.py

Large diffs are not rendered by default.

Loading

0 comments on commit 4f2fc25

Please sign in to comment.