Code Monkey home page Code Monkey logo

go-trace's Introduction

go-trace

Implementing a Path Tracer so that I can teach myself the Go language.

Now with more concurrency! ✨

Following the E-book by Peter Shirley 'Ray Tracing in One Weekend', but in Go instead of C++.

I also wrote a series of posts chronicling the process on my blog.

'Scene'

Options

$ ./bin/go-trace -help
Usage of ./bin/go-trace:
  -a value
        camera aperture (default 0.010000)
  -cpus value
        number of CPUs to use (default 8)
  -fov value
        vertical field of view (degrees) (default 75.000000)
  -h value
        height of image (pixels) (default 500)
  -n value
        number of samples per pixel for AA (default 100)
  -o value
        output filename (default out.png)
  -version
        show version and exit
  -w value
        width of image (pixels) (default 600)
  -x float
        look from X (default 10)
  -y float
        look from Y (default 4)
  -z float
        look from Z (default 6)

Running

$ make
go build -o bin/go-trace github.com/markphelps/go-trace/cmd/go-trace
$ ./bin/go-trace

Rendering 600 x 500 pixel scene with 486 objects:
[4 cpus, 100 samples/pixel, 75.00° fov, 0.01 aperture]

[==========----------------------------------------------------------------------] 12.80%

Tests

$ make test

Output

The default output format is PNG and the default filename is out.png.

This can be changed by using the -o flag as described in the help output.

Ex: $ ./bin/go-trace -o output.jpeg

Current supported file extensions:

  • .png
  • .jpg
  • .jpeg

go-trace's People

Contributors

markphelps avatar zephyr avatar

Watchers

Mr Tom 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.