Giter VIP home page Giter VIP logo

wwdc2021-thehackofraytracing's Introduction

wwdc2021

My wwdc2021 submission The HackOf RayTracing

How to run
  • Install swift playground from App Store on your Mac or iPad
  • Double clik TheHackOfRayTracing.playgroundbook to run on Mac
  • Or Airdrop TheHackOfRayTracing.playgroundbook to iPad and run it

gif

About my work

Last year I made a playground about visualizing four-dimensional cube. I have a keen interest in computer graphics. So this year I make a playgroundbook about Ray Tracing. I mainly use MetalKit and compute shader to make a ray tracing engine running on iPad in real time.

To accelerate my application, I use MetalKit creating threads and threadgroups to control every individual pixel on screen. And I code lots of shader programs to create my own ray tracing engine. Fortunately because of the powerful performance of iPad, it can run more than 30FPS on newest Pro model. I also use UIGestureRecognizer to allow you to move the camera and soar in the ray tracing scene.

It's a ray tracing engine I built from scratch, including building path tracing algorithms, different materials, camera system, anti-aliasing, and even a pseudo-random number table. Interestingly, I used random numbers and some filtering algorithms to create a scene of the Milky Way, which you can see on the last page. In short, many 3D mathematics and radiometric algorithms are used in the shaders.

I not only built a ray tracing system for readers to experience, I hope readers can also understand the hack of it. So I use SpriteKit and SceneKit to visualize the mathematical process like how ray finding the point of intersection. The visualization process is all interactive.

cover

wwdc2021-thehackofraytracing's People

Contributors

haoboxuxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.