Giter Club home page Giter Club logo

graytracer's Introduction

graytracer

Build

Raytracer written in Go, based on the book The Ray Tracer Challenge by Jamis Buck.

Current progress

Latest Render

Benchmark stats

Benchmarks of primitives calculation

pkg: github.com/factorion/graytracer/pkg/primitives cpu: AMD Ryzen 7 5800H with Radeon Graphics

Function Iterations Speed Memory Allocations
BenchmarkSubmatrix4x4-16 10416955 114.4 ns/op 152 B/op 4 allocs/op
BenchmarkMatrixMultiply-16 6347768 189.2 ns/op 224 B/op 5 allocs/op
BenchmarkMatrixDeterminant4x4-16 799813 1514 ns/op 1568 B/op 52 allocs/op
BenchmarkMatrixMinor3x3-16 14114458 83.44 ns/op 80 B/op 3 allocs/op
BenchmarkMatrixCofactor3x3-16 14621076 81.79 ns/op 80 B/op 3 allocs/op
BenchmarkMatrixInverse4x4-16 151344 7859 ns/op 8064 B/op 265 allocs/op
BenchmarkPVTransform-16 255785548 4.582 ns/op 0 B/op 0 allocs/op
BenchmarkPVReflect-16 707641048 1.715 ns/op 0 B/op 0 allocs/op
BenchmarkRayTransform-16 88858610 13.39 ns/op 0 B/op 0 allocs/op

Benchmarks of basic shape calculations

pkg: github.com/factorion/graytracer/pkg/shapes cpu: AMD Ryzen 7 5800H with Radeon Graphics

Function Iterations Speed Memory Allocations
BenchmarkConeIntersection-16 9989410 121.4 ns/op 128 B/op 2 allocs/op
BenchmarkConeNormal-16 7841389 155.3 ns/op 224 B/op 5 allocs/op
BenchmarkCubeIntersection-16 15381164 70.61 ns/op 80 B/op 1 allocs/op
BenchmarkCubeNormal-16 7521614 156.3 ns/op 224 B/op 5 allocs/op
BenchmarkCylinderIntersection-16 9446713 124.3 ns/op 128 B/op 2 allocs/op
BenchmarkCylinderNormal-16 7790467 151.1 ns/op 224 B/op 5 allocs/op
BenchmarkPlaneIntersection-16 19712168 60.18 ns/op 48 B/op 1 allocs/op
BenchmarkPlaneNormal-16 8302458 148.8 ns/op 224 B/op 5 allocs/op
BenchmarkSphereIntersection-16 9833896 120.2 ns/op 128 B/op 2 allocs/op
BenchmarkSphereNormal-16 7740237 150.4 ns/op 224 B/op 5 allocs/op
BenchmarkTriangleIntersection-16 16434596 71.02 ns/op 48 B/op 1 allocs/op
BenchmarkTriangleNormal-16 8217364 143.5 ns/op 224 B/op 5 allocs/op

Benchmarks of different bounding box setups with 4096 spheres

pkg: github.com/factorion/graytracer/pkg/components cpu: AMD Ryzen 7 5800H with Radeon Graphics

Function Iterations Speed Memory Allocations
BenchmarkNoBoundingBoxes-16 4136 291257 ns/op 7936 B/op 113 allocs/op
Benchmark8BoundingBoxes-16 18379 64370 ns/op 10080 B/op 124 allocs/op
Benchmark64BoundingBoxes-16 60115 20114 ns/op 10240 B/op 129 allocs/op

graytracer's People

Contributors

jarrodbegnoche avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mysangle

graytracer's Issues

Sphere normal

Add functionality to calculate the normal on a point on a sphere

Bounding Boxes

Create bounding boxes to better handle group intersection handling.

World

Create the world, which will hold all the objects inside as well as other information. Also possibly add multi-threading to increase performance.

Planes

Time to add a new shape, it can't all be spheres.

Transforms

Create transforms module and necessary functionality

Camera View

Add camera and view, along with their transformation matrices.

Triangles

Incorporate basic triangle shape.

Fix vector/point differentiation

Right now vector represents both vectors and points, it should be different between the two but share a lot of the code base.

Add matrix module

Need a matrix module for square matrices with basic functionality

Spheres

Add sphere module with ray intersection

Shadows

Add basic shadow detection to rendering.

Patterns

Add a pattern class and basic patterns

OBJ files

Support for OBJ file loading and rendering

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.