Coder Social home page Coder Social logo

aether's Introduction

Aether

Aether is a domain specific sampling language for Monte Carlo rendering. The user writes sampling code and Aether automatically generates all necessary probability density function code.

Details of the language are presented in the paper "Aether: An Embedded Domain Specific Sampling Language for Monte Carlo Rendering" (https://people.csail.mit.edu/lukea/aether) by Luke Anderson, Tzu-Mao Li, Jaakko Lehtinen, and Frédo Durand.

A Simple Example

#include <iostream>
#include "aether/RandomVar.h"

int main() {
  // Create a symbolic uniform random variable
  aether::variable<0> u;

  // Transform u -> sin(u)
  auto rv = make_random_var(sin(u));

  // Draw a sample from rv
  auto x = rv.Sample(0.75);

  // Compute the PDF of x using Aether's provided Pdf method
  auto pdfX = x.Pdf();

  // Compute the PDF of some other value not generated by rv
  auto pdfOther = x.Pdf(0.2);

  // x is a symbolic; x.Value() obtains the actual stored sample value
  std::cout << "x: " << x.Value() << std::endl;
  std::cout << "pdfX: " << pdfX << std::endl;
  std::cout << "pdfOther: " << pdfOther << std::endl;
  
  return 0;
}

Compiling the Example

Aether is header only so doesn't need to be compiled itself before use. It has been tested with clang 3.7 (with -std=c++1z) and depends on Eigen. To compile the example:

clang++ example.cpp -std=c++1z -stdlib=libc++ -o example

Aether makes extensive use of template metaprogramming. To avoid template/constexpr maximum step/depth related compiler errors, more complex examples will likely require the following additional flags:

-ftemplate-depth=512
-fconstexpr-steps=127124200
-fconstexpr-depth=720

Using Aether in a Renderer

Aether was designed for use in Monte Carlo rendering algorithms. Yotsuba is a Mitsuba based renderer that uses Aether to generate samples and compute PDFs. It contains implementations of many standard rendering algorithms and is a good place to learn about how Aether can be incorporated into a renderer and how to write rendering algorithms using Aether.

Contact

Please contact Luke Anderson (lukea at mit.edu) or Tzu-Mao Li (tzumao at mit.edu) if there are any issues/comments/questions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.