Modified version of mitsuba renderer target for learning rendering.
- Use python 3.x and SCons 4.x for compiling.
- Generate compile commands with SCons 4.x, we can use clangd for intellisense.
- Add support for package manager Conan
- Fix compilation with C++ 17
- Fix overflow in render setting UI (only happens in release mode)
- Use Conan for most dependencies: OpenEXR 2.5.5, Boost 1.79.0, Eigen 3.4.0, fftw 3.3.9, xerces-c 3.2.3, libpng 1.6.37, libjpeg 9d, glew 2.2.0, QT 5.15.4
Known problems:
For dependencySolved by usingxerces-c, when building with VS2022. Modify theC:/Users/xxx/.conan/data/xerces-c/xxx/source/source_subfolder/cmake/XercesFunctions.cmake: addinclude(CheckSymbolExists)and replace thecheck_function_exists(gettimeofday HAVE_GETTIMEOFDAY)withcheck_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY).Ninjaas the cmake generator.
First open the developer powershell for VS 2022 with x64 as the host architecture, then run
cp build/config-win64-msvc2022.py config.py
cd build
$env:CONAN_CMAKE_GENERATOR='Ninja'; $env:CONAN_REVISIONS_ENABLED=1; $env:CONAN_SYSREQUIRES_MODE='enabled'; conan install .. --build=missing
cd ..
scons -j 16Refer to the dockerfile.
Quickly build with docker. And the compile process can refer to the dockerfile.
You can forward X11 to support mtsgui.
docker build -t xxx/mitsuba .
docker run -it --name "mitsuba" --network host --gpus=all -v /tmp/.X11-unix/:/tmp/.X11-unix -e DISPLAY xxx/mitsuba /bin/bash- openvdbvolume: openvdb volume data source
- nanovdbvolume: nanovdb volume data source
- ratiotracking: transmittance estimation for heterogeneous medium
- nextflight: next flight estimator for transmittance estimation
- pseriesratio: P-series ratio tracking estimator for transmittance estimation
- pseriescumulative: P-series cumulative estimator for transmittance estimation
- pseriescmf: P-series CMF estimator for transmittance estimation
- multipass_volpath: modified
volpathintegrator that supports multiple passes
May implement some recent papers.
Implemented in file volume/openvdbvolume.cpp.
filename: the file path of the openvdb filegridname: explicitly use the given grid in the vdb, if not given, use the first onecustomStepSize: default set to half of the voxel size
Example:
<volume name="density" type="openvdbvolume">
<string name="filename" value="bunny_cloud.vdb"/>
<transform name="toWorld">
<scale value="0.05"/>
<translate y="-1"/>
</transform>
</volume>Implemented in file volume/nanovdbvolume.cpp.
filename: the file path of the openvdb filegridname: explicitly use the given grid in the vdb, if not given, use the first onecustomStepSize: default set to half of the voxel size
Example:
<volume name="density" type="nanovdbvolume">
<string name="filename" value="bunny_cloud.vdb"/>
<transform name="toWorld">
<scale value="0.05"/>
<translate y="-1"/>
</transform>
</volume>Implemented in file medium/heterogeneous.cpp.
Novák J, Selle A, Jarosz W. Residual ratio tracking for estimating attenuation in participating media[J]. ACM Trans. Graph., 2014, 33(6): 179:1-179:11.
See details: https://cs.dartmouth.edu/wjarosz/publications/novak14residual.html
Example:
<medium type="heterogeneous" id="smoke">
<string name="method" value="ratiotracking"/>
</medium>Implemented in file medium/heterogeneous.cpp.
Novák J, Georgiev I, Hanika J, et al. Monte Carlo methods for volumetric light transport simulation[C]//Computer Graphics Forum. 2018, 37(2).
See details: https://cs.dartmouth.edu/wjarosz/publications/novak18monte.html
Example:
<medium type="heterogeneous" id="smoke">
<string name="method" value="nextflight"/>
</medium>Implemented in file medium/heterogeneous.cpp.
Georgiev I, Misso Z, Hachisuka T, et al. Integral formulations of volumetric transmittance[J]. ACM Transactions on Graphics (TOG), 2019.
See details: https://cs.dartmouth.edu/wjarosz/publications/georgiev19integral.html
Example:
<medium type="heterogeneous" id="smoke">
<string name="method" value="pseriesratio"/>
</medium>Implemented in file medium/heterogeneous.cpp.
Georgiev I, Misso Z, Hachisuka T, et al. Integral formulations of volumetric transmittance[J]. ACM Transactions on Graphics (TOG), 2019.
See details: https://cs.dartmouth.edu/wjarosz/publications/georgiev19integral.html
One note in implementation: use double to accumulate W, it may become inf when grid domain is large when using float.
Example:
<medium type="heterogeneous" id="smoke">
<string name="method" value="pseriescumulative"/>
</medium>Implemented in file medium/heterogeneous.cpp.
Georgiev I, Misso Z, Hachisuka T, et al. Integral formulations of volumetric transmittance[J]. ACM Transactions on Graphics (TOG), 2019.
See details: https://cs.dartmouth.edu/wjarosz/publications/georgiev19integral.html
Example:
<medium type="heterogeneous" id="smoke">
<string name="method" value="pseriescmf"/>
</medium>Implemented in file integrators/path/multipass_volpath.cpp.
Modify the volpath integrator to support multiple passes. More interactive and a try because some other integrators may some operations between different pass.
sppPerPass: the spp for each pass, the pass count will be calculated automatically according to total sample count. Do not use withpassCount.passCount: the total pass count, spp per pass will be calculated automatically according to total sample count. Do not use withsppPerPass.
Example:
<integrator type="multipass_volpath">
<integer name="maxDepth" value="8"/>
<integer name="sppPerPass" value="4"/>
</integrator>Mitsuba is a research-oriented rendering system in the style of PBRT, from which it derives much inspiration. It is written in portable C++, implements unbiased as well as biased techniques, and contains heavy optimizations targeted towards current CPU architectures. Mitsuba is extremely modular: it consists of a small set of core libraries and over 100 different plugins that implement functionality ranging from materials and light sources to complete rendering algorithms.
In comparison to other open source renderers, Mitsuba places a strong emphasis on experimental rendering techniques, such as path-based formulations of Metropolis Light Transport and volumetric modeling approaches. Thus, it may be of genuine interest to those who would like to experiment with such techniques that haven't yet found their way into mainstream renderers, and it also provides a solid foundation for research in this domain.
The renderer currently runs on Linux, MacOS X and Microsoft Windows and makes use of SSE2 optimizations on x86 and x86_64 platforms. So far, its main use has been as a testbed for algorithm development in computer graphics, but there are many other interesting applications.
Mitsuba comes with a command-line interface as well as a graphical frontend to interactively explore scenes. While navigating, a rough preview is shown that becomes increasingly accurate as soon as all movements are stopped. Once a viewpoint has been chosen, a wide range of rendering techniques can be used to generate images, and their parameters can be tuned from within the program.
For compilation, usage, and a full plugin reference, please see the official documentation.
Pre-built binaries, as well as example scenes, are available on the Mitsuba website.