Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
/ mortar Public archive

A physically-based renderer utilizing Vulkan & DX12 raytracing API along with the implementation of several graphics papers.

Notifications You must be signed in to change notification settings

jamornsriwasansak/mortar

Repository files navigation

Note

Always underconstruction

I deprecated the old Vulkan backend and replaced with a new backend that supports both Vulkan and DX12. The shader language is also changed from GLSL to HLSL. Many features are therefore also deprecated. For now, please do not clone the code. I will slowly port the features from the old backend to the new one.


Mortar - A fast (enough) physically based renderer

Mortar is a small physically based renderer with agnostic api. It can use either Vulkan or DX12 as a backend. For now, it was intended for offline usage but seems fast enough for real-time as well.

The Toilet Scene Fireplace Room

Note: These images are generated by vulkan path tracing code that is now deprecated.

Input

At this moment, the application accepts OBJ format for loading models and HDR format for environment map. It guesses the ggx parameters from MTL file provided along with OBJ. Roughness values are mapped from specular exponents (Ns values) using Blinn-Phong to microfacet mapping mentioned in Brian Karis' blog.

As I do not have much time at this moment, changing the scene requires you to modify the code by yourself. An example is in "src/mainloop.cpp"

Features

In its current early stage, it supports:

  • DX12 and Vulkan backend with same interface.
  • GPU-based PCG random number generator ported from pcg-random.org
  • Lambert diffuse BRDF
  • FPS-style camera for traversing the scene
  • Spatiotemporal reservoir resampling (Biased) from Bitterli et al. 2020

Feature (Deprecated and will be added back)

  • Alpha-testing
  • GPU-based Low discreprancy sampler with blue-noise property ported from Heitz et al. [2019] (code)
  • GGX Microfacet BSDF (rough conductor and rough dielectric) (code)
  • Environment map importance sampling (code)
  • Ambient occlusion Integrator (code)
  • Path tracer with next event estimation utilizing MIS Veach's thesis [1997] (code)
  • GPU-based voxelizer (code)
  • Voxel-based probe placement from Silvenoinen et al. (code)

Dependencies

The following dependencies aside from vulkan sdk are already included as submodules

  • vulkan sdk >= 1.2
  • D3D12MemoryAllocator
  • DirectX-Headers
  • DirectXShaderCompiler
  • SPIRV-Reflect
  • VulkanMemoryAllocator
  • assimp
  • glfw
  • glm
  • spdlog
  • stb

About

A physically-based renderer utilizing Vulkan & DX12 raytracing API along with the implementation of several graphics papers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published