Skip to content

A (hopefully) real-time path tracing engine for voxel scenes in OpenGL

License

Notifications You must be signed in to change notification settings

ItayGigi/OpenGLVoxelPathTracer

Repository files navigation

Unnamed Voxel Path Tracer Engine

A real-time voxel path-tracer using a fast DDA voxel traversal algorithm and spatiotemporal reprojection.

Scene Structure

The scene consists of low level 8x8x8 voxel grids called 'bricks' and a high level 'brick map' grid that specifies which brick to use in each cell.

  • Scenes are loaded entirely from .scene and MagicaVoxel .vox files.
  • Each brick can contain up to 15 materials, with color, emission, and roughness properties loaded from MagicaVoxel.
  • Each brick-map can contain up to 15 bricks that should be specified in the pallet in order (pallet colors 1-15).
  • The camera is initialized to the saved camera in the 0 slot in the brick-map file.
  • The sky can be either a sample sky shader, or a uniform color loaded from the brick-map pallet in index 255 (with an emission mat applied).

Scene file

A scene file should start with the brick-map MagicaVoxel file, followed by 'sky' or 'color' depending on the sky choice, and then all of the brick MagicaVoxel files in order, all seperated by whitespaces (see assets folder for examples).

Controls

WASD + Space + Ctrl to move, Alt to unlock the cursor.

Showcase

voxel.menger.showcase.mp4

grass scene

menger scene

dragon scene

minecraft scene

What's Next?

  • In-game scene editing
  • Better material lighting
  • Overhaul scene representation to use a Sparse Voxel Octree
  • Minecraft world/schematic loading?
  • Try AI denoising solutions?

References

About

A (hopefully) real-time path tracing engine for voxel scenes in OpenGL

Topics

Resources

License

Stars

Watchers

Forks

Languages