Coder Social home page Coder Social logo

geoeo / toypathtracer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aras-p/toypathtracer

0.0 2.0 0.0 328 KB

Toy path tracer for my own learning purposes

License: The Unlicense

Objective-C 0.92% Objective-C++ 6.42% Metal 6.55% C 8.12% C++ 44.39% HLSL 6.09% C# 27.51%

toypathtracer's Introduction

Toy Path Tracer

Toy path tracer for my own learning purposes, using various approaches/techs. Somewhat based on Peter Shirley's Ray Tracing in One Weekend minibook (highly recommended!), and on Kevin Beason's smallpt.

I decided to write blog posts about things I discover as I do this, currently:

Right now: can only do spheres, no bounding volume hierachy of any sorts, a lot of stuff hardcoded.

Implementations I'm playing with (again, everything is in toy/learning/WIP state; likely suboptimal) are below. These are all on a scene with ~50 spheres and two light sources, measured in Mray/s.

  • CPU. Testing on "PC" AMD ThreadRipper 1950X 3.4GHz (SMT disabled, 16c/16t) and "Mac" late 2013 MacBookPro 2.3GHz (4c/8t):
    • C++ w/ some SSE SIMD: PC 187, Mac 41.8
    • C++: PC 100, Mac 19.6
    • C# (Unity with Burst compiler): PC 82, Mac 18.7. Note that this is super early version of Burst.
    • C# (.NET Core): PC 53, Mac 13.1
    • C# (Mono with optimized settings): Mac 12.7
    • C# (Mono defaults): Mac 5.5
  • GPU. Super simplistic direct ports:
    • D3D11 compute shader. GeForce GTX 1080 Ti: 778
    • Metal compute shader. Intel Iris Pro: 53.0

A lot of stuff in the implementation is totally suboptimal or using the tech in a "wrong" way. I know it's just a simple toy, ok :)

Screenshot

Building

  • C++ projects: Windows (Visual Studio 2017) in Cpp/Windows/TestCpu.sln, Mac (Xcode 9) in Cpp/Mac/Test.xcodeproj.
    • Windows is DX11 Win32 app that displays result as a fullscreen CPU-updated or GPU-rendered texture.
    • Mac is a Metal app that displays result as a fullscreen CPU-updated or GPU-rendered texture.
  • C# project in Cs/TestCs.sln. A command line app that renders some frames and dumps out final TGA screenshot at the end.
  • Unity project in Unity. I used 2018.1 beta 12 version linked to from ECS samples.

toypathtracer's People

Contributors

aras-p avatar rygorous avatar egorbo avatar

Watchers

James Cloos avatar Marc Haubenstock 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.