Git Product home page Git Product logo

path-tracer's Introduction

Ray Tracing in one weekend in zig

CI

Implementation of Peter Shirley's Ray Tracing in One Weekend book in the Zig programming language.

Tested on Zig version 0.9.1.

scene 21 rendered with 150 samples per pixel, depth 6, seed 456

Installation

Clone the repo and jump into it:

git clone [email protected]:jackdbd/path-tracer.git
cd path-tracer

In order to use this library and run the examples you will need zig version 0.9.1. You can get it using zigup:

zigup fetch 0.9.1
zigup 0.9.1

Build

Build and run the executable in debug mode.

zig build run

Build the executable in release-fast mode, then run it.

zig build -Drelease-fast --verbose
# run it
./zig-out/bin/ray-tracing-in-one-weekend-zig

Tests

Run all tests:

zig build test

Otherwise, run all tests defined in a single file:

zig test src/material.zig
zig test src/utils.zig
zig test src/render_targets/ppm_image.zig --main-pkg-path ./src

Other

Format all zig code

zig fmt src

TODO

  • implement example with async and await
  • implement more scenes
  • improve documentation about Monte Carlo path tracing algorithm and global illumination model
  • generate docs with zig test src/utils.zig -femit-docs=./docs or similar command
  • fix issues with zig-clap

path-tracer's People

Contributors

jackdbd avatar

Stargazers

 avatar

Watchers

 avatar

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.