mitransient
Code for "Non-line-of-sight transient rendering" in Mitsuba 3 - Full implementation of transient path tracing - pip install mitransient
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
✓Academic publication links
Links to: sciencedirect.com -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Keywords
Repository
Code for "Non-line-of-sight transient rendering" in Mitsuba 3 - Full implementation of transient path tracing - pip install mitransient
Basic Info
Statistics
- Stars: 56
- Watchers: 3
- Forks: 10
- Open Issues: 1
- Releases: 5
Topics
Metadata Files
README.md
mitransient
Transient light transport in Mitsuba 3
Diego Royo Miguel Crespo Jorge Garcia-Pueyo
Overview
mitransient is a library adds support to Mitsuba 3 for doing transient simulations, with amazing support for non-line-of-sight (NLOS) data capture simulations.
Main features
- Foundation ready to use: easy interface to convert your algorithms to the transient domain.
- Python-only library for doing transient rendering in both CPU and GPU.
- Several integrators already implemented: transient pathtracing (also adapted for NLOS scenes) and transient volumetric pathtracing.
- Cross-platform: Mitsuba 3 has been tested on Linux (x8664), macOS (aarch64, x8664), and Windows (x86_64).
- Temporal domain filtering.
[!TIP] Check out our online documentation (mitransient.readthedocs.io) and our code examples:
Featuring General Usage, Transient rendering, and Non-line-of-sight (NLOS) transient rendering
License and citation
This project was created by Miguel Crespo and expanded by Diego Royo and Jorge Garcia-Pueyo. Also see the original Mitsuba 3 license and contributors.
If you use our code in your project, please consider citing us using the following:
bibtex
@misc{mitransient,
title = {mitransient},
author = {Royo, Diego and Crespo, Miguel and Garcia-Pueyo, Jorge},
year = 2023,
journal = {GitHub repository},
doi = {https://doi.org/10.5281/zenodo.11032518},
publisher = {GitHub},
howpublished = {\url{https://github.com/diegoroyo/mitransient}}
}
Additionally, the NLOS features were re-implemented from our publication Non-line-of-sight transient rendering. Please also consider citing us if you use them:
bibtex
@article{royo2022non,
title = {Non-line-of-sight transient rendering},
author = {Diego Royo and Jorge García and Adolfo Muñoz and Adrian Jarabo},
year = 2022,
journal = {Computers & Graphics},
doi = {https://doi.org/10.1016/j.cag.2022.07.003},
issn = {0097-8493},
url = {https://www.sciencedirect.com/science/article/pii/S0097849322001200}
}
What is transient rendering?
Conventional rendering is referred to as steady state, where the light propagation speed is assumed to be infinite. In contrast, transient rendering breaks this assumption allowing us to simulate light in motion (see the teaser image for a visual example).
For example, path tracing algorithms integrate over multiple paths that connect a light source with the camera. For a known path, transient path tracing uses the very complex formula of time = distance / speed (see [Two New Sciences by Galileo]) to compute the time when each photon arrives at the camera from the path's distance and light's speed. This adds a new time dimension to the captured images (i.e. it's a video now). The simulations now take new parameters as input: when to start recording the video, how long is each time step (framerate), and how many frames to record.
Note: note that the time values we need to compute are very small (e.g. light takes only ~3.33 * 10^-9 seconds to travel 1 meter), time is usually measured in optical path distance. See Wikipedia for more information. TL;DR opl = distance * refractive_index
Installation
We provide the package via PyPI. To install mitransient you need to run:
bash
pip install mitransient
[!IMPORTANT] In order to run
mitransientyou also need to install Mitsuba 3. If you have installed Mitsuba 3 viapip(pip install mitsuba) you will only have access to thellvm_ad_rgbandcuda_ad_rgbvariants. If you want to use other variants (e.g. NLOS simulations can greatly benefit from thellvm_monovariant which only propagates one wavelength), then we recommend that you compile Mitsuba 3 yourself following this tutorial and enable the following variants:["scalar_mono", "llvm_mono", "llvm_ad_mono", "cuda_mono", "cuda_ad_mono", "scalar_rgb", "llvm_rgb", "llvm_ad_rgb", "cuda_rgb", "cuda_ad_rgb"].
Requirements
Python >= 3.8Mitsuba3 >= 3.5.0- (optional) For computation on the GPU:
Nvidia driver >= 495.89 - (optional) For vectorized / parallel computation on the CPU:
LLVM >= 11.1
After installation
At this point, you should be able to import mitsuba and import mitransient in your Python code (careful about setting the correct PATH environment variable if you have compiled Mitsuba 3 yourself, see the section below).
For NLOS data capture simulations, see https://github.com/diegoroyo/tal. tal is a toolkit that allows you to create and simulate NLOS scenes with an easier shell interface instead of directly from Python.
If you use your own Mitsuba 3
If you have opted for using a custom (non-default installation through pip) Mitsuba 3, you have several options for it. The idea here is to be able to control which version of Mitsuba will be loaded on demand.
- One solution is to directly execute
setpath.shprovided after the compilation of the Mitsuba 3 repo (More info). This shell script will modify thePATHandPYTHONPATHvariables to load first this version of Mitsuba. - Another solution following the previous one is to directly set yourself the
PYTHONPATHenvironment variable as you wish. - Another solution for having a custom version globally available is by using
pip install . --editable. This will create a symlink copy of the package files inside the correspondingsite-packagesfolder and will be listed as a package installed ofpipand will be available as other packages installed. If you recompile them, you will still have the newest version directly to use. Please follow these instructions:- Go to
<mitsuba-path>/mitsuba3/build/python/drjitand executepip install . --editable. - Go to
<mitsuba-path>/mitsuba3/build/python/mitsubaand executepip install . --editable.
- Go to
- If you are a user of Jupyter Notebooks, the easiest solution will be to add the following snippet of code to modify the notebook's
PYTHONPATH:python import sys sys.path.insert(0, '<mitsuba-path>/mitsuba3/build/python') import mitsuba as mi
Usage
[!TIP] Check out the
examplesfolder for practical usage!
You are now prepared to render your first transient scene with mitransient. Running the code below will render the famous Cornell Box scene in transient domain and show a video.
```python import mitsuba as mi mi.setvariant('llvmad_rgb') import mitransient as mitr
scene = mi.loaddict(mitr.cornellbox()) transientintegrator = scene.integrator() transientintegrator.preparetransient(scene, sensor=0) imgsteady, imgtransient = transientintegrator.render(scene, spp=1024)
import numpy as np imgtransienttonemap = mitr.vis.tonemaptransient( np.moveaxis(imgtransient, 0, 1) ) mitr.vis.showvideo( imgtransienttonemap, axisvideo=2, ) ```
Plugins implemented
mitransient implements the following plugins which can be used in scene XML files. To view a description of their parameters, click on the name of your desired plugin.
* film:
* transient_hdr_film: Transient equivalent of Mitsuba 3's hdrfilm plugin.
* integrators:
* transient_path: Transient path tracing for line-of-sight scenes. If you want to do NLOS simulations, use transientnlospath instead.
* transient_nlos_path: Transient path tracing with specific sampling routines for NLOS scenes (e.g. laser sampling and hidden geometry sampling of the "Non-Line-of-Sight Transient Rendering" paper).
* transient_prbvolpath: Path Replay Backpropagation for volumetric path tracing. Implemented by Miguel Crespo, untested.
* sensor:
* nlos_capture_meter: Can be attached to one of the scene's geometries, and measures uniformly-spaced points on such geometry (e.g. relay wall).
Testing
Our test suite can be run using pytest on the root folder of the repo.
Contributors
Diego Royo 🎨 💻 📣 📖 |
Miguel Crespo 🎨 💻 📣 |
Jorge Garcia Pueyo 🎨 💻 📣 📖 |
DiegoBielsa 🐛 |
p-luesia 📖 |
See emoji key for details.
Owner
- Name: Diego Royo
- Login: diegoroyo
- Kind: user
- Location: Universidad de Zaragoza
- Website: https://diego.contact
- Repositories: 21
- Profile: https://github.com/diegoroyo
Citation (CITATION.cff)
cff-version: 1.2.0
title: Transient Mitsuba 3
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Diego
family-names: Royo
- given-names: Miguel
family-names: Crespo
- given-names: Jorge
family-names: Garcia
identifiers:
- type: doi
value: 10.5281/zenodo.11032518
description: Zenodo
repository-code: 'https://github.com/diegoroyo/mitransient'
url: 'https://github.com/diegoroyo/mitransient'
repository-artifact: 'https://pypi.org/project/mitransient/'
abstract: >-
This library adds support to Mitsuba 3 for doing transient
simulations, with amazing support for non-line-of-sight
(NLOS) data capture simulations.
keywords:
- transient
- nlos
- mitsuba
- physically-based rendering
- differentiable rendering
license: BSD-4-Clause
GitHub Events
Total
- Create event: 7
- Issues event: 2
- Release event: 4
- Watch event: 23
- Issue comment event: 2
- Push event: 16
- Pull request event: 6
- Fork event: 8
Last Year
- Create event: 7
- Issues event: 2
- Release event: 4
- Watch event: 23
- Issue comment event: 2
- Push event: 16
- Pull request event: 6
- Fork event: 8
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 1
- Total pull requests: 4
- Average time to close issues: about 6 hours
- Average time to close pull requests: 7 days
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 1.0
- Average comments per pull request: 0.25
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 4
- Average time to close issues: about 6 hours
- Average time to close pull requests: 7 days
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 1.0
- Average comments per pull request: 0.25
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- lyd405121 (1)
Pull Request Authors
- DiegoBielsa (2)
- opueyociutad (1)
- lyd405121 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 49 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 9
- Total maintainers: 2
pypi.org: mitransient
Transient rendering extensions for Mitsuba 3
- Homepage: https://github.com/diegoroyo/mitransient
- Documentation: https://mitransient.readthedocs.io/
- License: BSD
-
Latest release: 1.1.2
published about 1 year ago
Rankings
Dependencies
- actions/checkout v4 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- mitsuba >=