Nori: an educational ray tracer

Apart from working on SIGGRAPH paper submissions, I’ve been helping my advisor Steve Marschner teach Cornell’s graduate-level graphics course CS6630 this semester. My job was to create a compact rendering framework that students can use (and understand) in a sequence of increasingly difficult assignments.

PBRT and Mitsuba were not an option: they are both much too large for a one-semester course, and all fun components are already “done” (i.e. not available for assignments). So we decided to make a new framework called Nori.

It is always tempting to stop working on a piece of code as soon as it produces good-looking results (which might still be subtly incorrect). An important design goal of Nori was to really force students to end up with the right answer. Thus, each assignment comes with a battery of statistical hypothesis tests to ensure correctness.



We use χ2 goodness of fit-tests to validate sample generation and Student’s t-test to check if the submitted MC integrators converge to the right value.

Everything is licensed under the GPL and thus also available to instructors at other institutions. If you are interested, please get in touch.

26 comments

  1. All nice and dandy, and I hope your students pass with high marks….but….and i’m sure a lot of people are silently pondering this :

    Any updates on Mitsuba ? Do you plan on developing it further?

  2. funny how the renderer you come up are named after food.

    i hope mitsuba development is progressing…

    regards
    abhi

  3. Very nice, same xml format as mitsuba :)

  4. Hi, I read the PDF manual and saw the video about Mitsuba, i think it’s pretty promising.

    Any chance to get a “ready to go” addon/plugin for Blender 2.6x? I can’t do it by myself and I would be really interested for testing it out with complex scenes and difficult lights and materials conditions…please let me know, Bye.

  5. Hey! Glad to hear you’re still working on Mitsuba :3 – Hope you can get a blender plugin working soon, I’d love to use this renderer for my projects (requires to much time at the moment to get a scene working). I feel bad though, I wish I could help instead of just plead >.<

    – At any rate what are your future plans for Mitsuba in the long run? I could see this renderer getting very popular as long as it gets easier to use.

    Oh btw for the plugin for blender I was wondering if you can possibly rename the materials? Just so it can be easier to figure out which one is which. I understand most of them but some required me to play to see what they were. – Just convenience thing for future users.

  6. wish there was an edit button – Um sorry about the blender plugin thing, just realized you said you can’t work on it in the near future. – But at any rate I can’t wait to see more from Mitsuba.

  7. Hi, congratulations for the beautiful rendering engine.

    But… not Ubuntu 32bit – why?

    I can’t install Win 32 version it doesn’t work because of dll errors.

    Details:

    – Downloaded Mitsuba 0.3.0 32bit.zip 02-Sep-2011
    – Installed vcredist_2010_sp1_x86 (from folder “Mitsuba 0.3.0″) – does not work
    – Installed msvcp100.dll – still does not work

    I tried to find relationships with the program Dependency Walker – the result is the image – link:

    http://imageshack.us/f/845/mguierror.jpg/

    Help me – pls

  8. Hi Bob,

    To compile Mitsuba on Ubuntu pls see the tips at https://www.mitsuba-renderer.org/tracker/issues/83. It’s not hard to build – just download the dependencies indicated in the Mitsuba .pdf manual, making the adjustments indicated above, and build.

    If you’re using Blender you can use the interface in the Mitsuba folder created by the build process. Unfortunately, the newer add-ons with more features such as http://bartoszstyperek.wordpress.com/2012/02/19/mitsuba-0-8-just-dof/ don’t seem to work with Linux.

  9. I was trying to install Nori for educational reasons and received this error when running make from the Nori directory, any thoughts? I am compiling on Mac OS X 10.6.8 and installed the required libraries before running qmake and make.

    In file included from include/nori/color.h:22,
    from include/nori/proplist.h:22,
    from include/nori/object.h:22,
    from src/common.cpp:1:
    include/nori/common.h:38:27: error: ImathPlatform.h: No such file or directory
    include/Eigen/src/LU/arch/Inverse_SSE.h: In static member function ‘static void Eigen::internal::compute_inverse_size4::run(const MatrixType&, ResultType&) [with MatrixType = Eigen::Matrix, ResultType = Eigen::Matrix]’:
    include/Eigen/src/LU/Inverse.h:305: instantiated from ‘void Eigen::internal::inverse_impl::evalTo(Dest&) const [with Dest = Eigen::Matrix, MatrixType = Eigen::Matrix]’
    include/Eigen/src/Core/ReturnByValue.h:74: instantiated from ‘void Eigen::ReturnByValue::evalTo(Dest&) const [with Dest = Eigen::Matrix, Derived = Eigen::internal::inverse_impl<Eigen::Matrix >]’
    include/Eigen/src/Core/Matrix.h:309: instantiated from ‘Eigen::Matrix::Matrix(const Eigen::ReturnByValue&) [with OtherDerived = Eigen::internal::inverse_impl<Eigen::Matrix >, _Scalar = float, int _Rows = 4, int _Cols = 4, int _Options = 0, int _MaxRows = 4, int _MaxCols = 4]’
    src/common.cpp:72: instantiated from here
    include/Eigen/src/LU/arch/Inverse_SSE.h:153: warning: dereferencing type-punned pointer will break strict-aliasing rules
    make: *** [build/common.o] Error 1

    • Hi,

      for some reason, the OpenEXR include files are not found (in particular, “ImathPlatform.h”). Are you sure that you fully installed this (i.e. “make install”) so that the header files ended up in /usr/include or /usr/local/include?

      Wenzel

      • Thanks for the quick reply – I reinstalled OpenEXR and now the build completes. However, when I try to run Nori ($./nori ./scenes/cbox/cbox.xml) or any of the other examples I get a “Caught a critical exception: A constructor for class ‘path’ could not be found!”

        • Right .. that is the “homework” to do :). There is no path tracer yet, you have to write it. There is an ambient occlusion renderer (“ao”) that you can use to get at least some kind of image. The *ao.xml scenes should work with that.

          Note that you have to start Nori from within the directory of your scene, so something like

          ../../nori some_scene.xml

  10. Hi,
    I am playing with your cute nori render and doing assignments. Can sample solutions to those assignments be made public? Or Mitsuba render is already excellent for reference?
    Regards,
    Guo

    • BTW, I have two stupid questions:
      In ao.cpp line 57,
      return Color3f(scene->rayIntersect(shadowRay) ? 0.0f : 1.0f);
      why not return INV_PI instead of one for energy conservation while the shadow ray is not occluded?
      In obj.cpp line 73,
      n = (trafo * n).normalized();
      why not multiply those normals by inverse transpose of trafo, just like gl_NormalMatrix in GLSL?
      Thanks in advance. :)

      • Hi,

        the ambient occlusion integrator computes the occlusion, which is between 1 and 0. You could just as well multiply that by INV_PI, and then it will be in [0, 1/pi] :).

        Regarding the inverse transpose transformation: that’s actually what is done if you look at how the Transform operator* is implemented for Normals.

        Cheers,
        Wenzel

        • Oops, I forgot that it is cosine weighted hemisphere importance sampling, so here one is necessary. Sorry for my hasty comment.
          Thanks again for your elegantly designed nori render. 😉

    • Hi,

      I think you can use Mitsuba as a reference. I can only share the solutions with other course instructors — sorry!

      Wenzel

  11. I was trying to compile the latest version from github on OS X Yosemite, everything was going good until this error appeared

    Undefined symbols for architecture x86_64:
    “Imf_2_2::TypedAttribute::readValueFrom(Imf_2_2::IStream&, int, int)”, referenced from:
    vtable for Imf_2_2::TypedAttribute in bitmap.o
    “Imf_2_2::TypedAttribute::staticTypeName()”, referenced from:
    Imf_2_2::TypedAttribute::typeName() const in bitmap.o
    “Imf_2_2::TypedAttribute::writeValueTo(Imf_2_2::OStream&, int) const”, referenced from:
    vtable for Imf_2_2::TypedAttribute in bitmap.o
    “vtable for NoriWindow”, referenced from:
    NoriWindow::NoriWindow(nori::ImageBlock const*) in gui.o
    NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [nori] Error 1
    01:16:10: Le processus “/usr/bin/make” s’est terminé avec le code 2.
    Erreur lors de la compilation/déploiement du projet nori (kit : Desktop Qt 5.3 clang 64bit)
    When executing step “Make”

    Don’t know how to proceed with that, I have installed OpenEXR but perhaps I missed something. Any advise?

    • To solve for “vtable for NoriWindow”, referenced from:
      NoriWindow::NoriWindow(nori::ImageBlock const*) in gui.o

      in the .pro file instead of having the line HEADERS += include/nori/*.h, I actually expanded the value of the variable with all the .h files, don’t know if I should modify some settings in order to make the original statement to work.

      • Hi Frederico,

        if you’re still having issues, I’d try reinstalling OpenEXR — maybe after a brew update, you have incompatible .dylib and header files installed on your system?

        Wenzel

Leave your reply to bob