Skip to content

Physically based renderer with Metal/Vulkan acceleration

License

Notifications You must be signed in to change notification settings

tsssni/metatron

Repository files navigation

dispersion Metatron

Introduction

Metatron is a physically based renderer unbiasedly simulating radiative transfer equation and spectral transport with Metal/Vulkan acceleration.

Resources

Features

  • Spectrum
    • Sampled spectra are used for rendering.
    • RGB compatibility via J19.
    • Real world spectra are used for conductor, dispersion and color space definition.
  • Medium
    • Null-scattering integral for heterogenous medium via MG19.
    • Phase function evaluation and sampling via HG41.
    • NanoVDB is supported for volume data.
  • BSDF
    • Unified physical BSDF for diffuse, dielectric, conductor and plastic surface via TS67.
    • Microfacet model and importance sampling via TR75 and H18.
  • Shape
    • Sphere as convenient bounding volume.
    • Mesh in various formats supported by assimp.
  • Light
    • Delta light including parallel, point and spot light.
    • Environment light with image importance sampling.
    • Area light for shapes with emissive material. Spherical triangle sampling via A95.
    • Atomosphere with alien world support via HW12 and HW13. TGMM sky sampling via VV21.
  • Integrator
    • LBVH with parallel construction via PL10.
    • Direct lighting and spectral MIS inspired by pbrt-v4.
    • Metal/Vulkan acceleration thanks to hardware ray tracing and slang.
    • Remote preview of rendering intermediates via tev

Build

Metatron use nix with flakes for package management on Linux and Darwin.

nix build

Or use cmake if dependencies are availabe. Installation is required for runtime resource loading.

cmake --preset rel -DCMAKE_INSTALL_PREFIX=/usr/bin/
cmake --build build/rel
cmake --install build/rel

Usage

Metatron can be used as a library. Use package output in flake.nix or copy package.nix to add metatron.

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    metatron.url = "github:tsssni/metatron";
  };
  outputs = {nixpkgs, metatron, ...}: let
    pkgs = import nixpkgs {
      system = "x86_64-linux";
      overlays = [
        (final: prev: {
          metatron = metatron.packages.default;
        })
      ];
    };
  in {
    # use pkgs.metatron somewhere
  };
}

Modules in src are all optional and chained.

find_package(metatron-core REQUIRED) # only import metaron-core
find_package(metatron-render REQUIRED) # import all as metatron-render depends them
target_link_libraries(renderer PUBLIC metatron-render)

Run

Run metatron-tracer -h for option documents.

metatron-tracer -s ~/metatron-scenes/classroom/ -o classroom.exr -a localhost:14158 -d gpu

About

Physically based renderer with Metal/Vulkan acceleration

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published