Coding Adventure: Ray Tracing

Sebastian Lague April 1, 2023
Video Thumbnail

About

No channel description available.

Video Description

I tried creating a custom ray/path tracing renderer. Featuring: maths, shaders, and cats! This project was written in C# and HLSL, and uses the Unity game engine. Support my work (and get early access to new videos and source code) on Patreon or Nebula * Patreon: https://www.patreon.com/SebastianLague * Nebula: https://go.nebula.tv/sebastianlague Source Code: * GitHub: https://github.com/SebLague/Ray-Tracing/tree/Episode01 Credits and References: * https://raytracing.github.io * https://blog.demofox.org/2020/05/25/casual-shadertoy-path-tracing-1-basic-camera-diffuse-emissive/ * Music: https://github.com/SebLague/Misc-Project-Info/blob/main/Coding-Adventures/Ray-Tracing.txt Chapters: 0:00 Intro 1:08 Cameras and Rays 3:30 The Pixel Shader 5:02 Drawing a Sphere 6:59 Multiple Spheres, and Colour! 8:21 Two Types of Reflections 9:04 Experimenting with Randomness 11:14 Random Hemisphere Directions 14:11 The Trace Function 16:35 Testing Lights 17:55 Chair Thief 18:23 Progressive Rendering 19:54 A Simple Sky 20:49 Lambert’s Cosine Law 22:47 Cosine Weighted Rays 22:36 Triangles 24:52 Some Tests 27:14 Specular Reflections 29:59 Tomatoes and Glossiness 31:57 Blur and Anti-Aliasing 34:42 Depth of Field 37:14 The End

Master Ray Tracing Today

AI-recommended products based on this video

Loading...
Seasonic Focus V4 GX-1000 (ATX3) - 1000W - 80+ Gold - ATX 3.0 & PCIe 5.1 Ready -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible

Seasonic Focus V4 GX-1000 (ATX3) - 1000W - 80+ Gold - ATX 3.0 & PCIe 5.1 Ready -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible

(22)
$423.35
FREE delivery Oct 8 - 10
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27
Loading...
STGAubron Gaming Desktop PC, AMD Athlon 3000G 3.5G, Radeon RX 580 16G GDDR5, 16G RAM, 512G SSD, 600M WiFi, BT 5.0, RGB Fan x4, Windows 11 Home

STGAubron Gaming Desktop PC, AMD Athlon 3000G 3.5G, Radeon RX 580 16G GDDR5, 16G RAM, 512G SSD, 600M WiFi, BT 5.0, RGB Fan x4, Windows 11 Home

(52)
$593.99
FREE delivery Wed, Jun 18
Loading...
MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

(1,034)
$1,749.36
Loading...
RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

(18)
$466.03$457.88
FREE delivery Feb 17 - 19
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27
Loading...
ASUS ROG Strix G16 Gaming Laptop, GeForce RTX 5070 Ti 12GB GDDR7, AMD Ryzen 9 8940HX, 64GB DDR5, 2TB SSD, Backlit Keyboard, Wi-Fi 6E, 16" WUXGA 165Hz Display, Win 11, Gray, 1TB Docking Station Set

ASUS ROG Strix G16 Gaming Laptop, GeForce RTX 5070 Ti 12GB GDDR7, AMD Ryzen 9 8940HX, 64GB DDR5, 2TB SSD, Backlit Keyboard, Wi-Fi 6E, 16" WUXGA 165Hz Display, Win 11, Gray, 1TB Docking Station Set

(10)
$4,269.00
FREE delivery Feb 24 - Mar 5
Loading...
MSI Thin 15 15.6" 144Hz Gaming Laptop, Intel® Core™ 5-210H, RTX 4050, 16GB DDR5, 1TB NVMe SSD, Windows 11 Home

MSI Thin 15 15.6" 144Hz Gaming Laptop, Intel® Core™ 5-210H, RTX 4050, 16GB DDR5, 1TB NVMe SSD, Windows 11 Home

(6)
$1,099.00
FREE delivery Mon, Feb 16
Loading...
Lenovo Legion 5 15.1" WQXGA 165Hz Gaming Laptop, Intel i9 14900HX, GeForce RTX 5070 8GB GDDR7, 16GB DDR5, 2TB Storage(1TB SSD+1TB Docking Station Set), 24-Zone RGB Backlit Keyboard, Windows 11, Black

Lenovo Legion 5 15.1" WQXGA 165Hz Gaming Laptop, Intel i9 14900HX, GeForce RTX 5070 8GB GDDR7, 16GB DDR5, 2TB Storage(1TB SSD+1TB Docking Station Set), 24-Zone RGB Backlit Keyboard, Windows 11, Black

(68)
$2,749.00
FREE delivery Feb 24 - Mar 5
Loading...
ASUS TUF F16 16" WUXGA 165Hz Gaming Laptop, Intel i7-14650HX, NVIDIA GeForce RTX 5070 8GB, 16GB DDR5, 1TB SSD, Backlit Keyboard, Number Pad, IR Camera, Wi-Fi 6E, Win 11, Gray, 1TB Docking Station Set

ASUS TUF F16 16" WUXGA 165Hz Gaming Laptop, Intel i7-14650HX, NVIDIA GeForce RTX 5070 8GB, 16GB DDR5, 1TB SSD, Backlit Keyboard, Number Pad, IR Camera, Wi-Fi 6E, Win 11, Gray, 1TB Docking Station Set

(10)
$2,429.00
FREE delivery Feb 24 - Mar 5Only 9 left in stock.
Loading...
KOORUI 34-inch Ultrawide Curved WQHD 3440×1440 Gaming Monitor, 165Hz 144Hz Curved 1000R- PIP/PBP, 1ms(MPRT) with DisplayHDR 400, DCI-P3 90% Color Gamut, AdaptiveSync, HDMI/DisplayPort, 34E6UC

KOORUI 34-inch Ultrawide Curved WQHD 3440×1440 Gaming Monitor, 165Hz 144Hz Curved 1000R- PIP/PBP, 1ms(MPRT) with DisplayHDR 400, DCI-P3 90% Color Gamut, AdaptiveSync, HDMI/DisplayPort, 34E6UC

(3,528)
$349.99
FREE delivery Sun, Aug 10
100+ bought in past month
Loading...
UPERFECT Portable Monitor 2K 144Hz 16.1" Portable Gaming Monitor for Laptop 2560x1440P QHD FreeSync HDR Ultra Slim Travel Monitor External Second Screen for PC Phone Game Console with Cover Stand

UPERFECT Portable Monitor 2K 144Hz 16.1" Portable Gaming Monitor for Laptop 2560x1440P QHD FreeSync HDR Ultra Slim Travel Monitor External Second Screen for PC Phone Game Console with Cover Stand

(2,824)
$284.99
PrimeOnly 3 left in stock.
Loading...
ViewSonic VX1755 17 Inch 1080p Portable IPS Gaming Monitor with 144Hz, AMD FreeSync Premium, 2 Way Powered 60W USB C, Mini HDMI, and Built-in Stand with Smart Cover

ViewSonic VX1755 17 Inch 1080p Portable IPS Gaming Monitor with 144Hz, AMD FreeSync Premium, 2 Way Powered 60W USB C, Mini HDMI, and Built-in Stand with Smart Cover

(385)
$468.70
FREE delivery Aug 18 - 27
Loading...
Portable Monitor, 18in 2.5K 2560x1600P IPS 144Hz Laptop Monitor, HDMI, Type C, Micro USB, 3.5mm Aux Interface, Portable Display Screen Extender for Laptop PC

Portable Monitor, 18in 2.5K 2560x1600P IPS 144Hz Laptop Monitor, HDMI, Type C, Micro USB, 3.5mm Aux Interface, Portable Display Screen Extender for Laptop PC

(0)
$377.76
FREE delivery Aug 27 - Sep 18
Loading...
MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

(1,034)
$1,749.36
Loading...
RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

(18)
$466.03$457.88
FREE delivery Feb 17 - 19
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27
Loading...
Asus ROG Swift 32” 4K OLED Gaming Monitor (PG32UCDM) - UHD (3840 x 2160), QD-OLED, 240Hz, 0.03ms, G-SYNC Compatible, Custom Heatsink, Graphene film, 99% DCI-P3, True 10-bit, 90W USB-C, 3 year warranty

Asus ROG Swift 32” 4K OLED Gaming Monitor (PG32UCDM) - UHD (3840 x 2160), QD-OLED, 240Hz, 0.03ms, G-SYNC Compatible, Custom Heatsink, Graphene film, 99% DCI-P3, True 10-bit, 90W USB-C, 3 year warranty

(909)
$1,663.35$1,355.90
FREE delivery Sat, Jan 3
Loading...
Asus ROG Swift 27” 4K QD-OLED Gaming Monitor (PG27UCDM) - 240Hz, 0.03ms, Custom Heatsink, Neo Proximity Sensor, G-SYNC Compatible, 99% DCI-P3, True 10-bit color, DisplayPort 2.1a UHBR20, 3 yr warranty

Asus ROG Swift 27” 4K QD-OLED Gaming Monitor (PG27UCDM) - 240Hz, 0.03ms, Custom Heatsink, Neo Proximity Sensor, G-SYNC Compatible, 99% DCI-P3, True 10-bit color, DisplayPort 2.1a UHBR20, 3 yr warranty

(64)
$1,199.99$1,115.99
FREE delivery Sat, Jan 3
50+ bought in past month
Loading...
Asus ROG Swift 32” 4K OLED Gaming Monitor (PG32UCDP) - WOLED, Dual Mode (4K 240Hz, FHD 480Hz), 0.03ms, G-SYNC Compatible, Custom Heatsink, AI Gaming, 99% DCI-P3,True 10-bit, USB-C 90W, 3yr Warranty

Asus ROG Swift 32” 4K OLED Gaming Monitor (PG32UCDP) - WOLED, Dual Mode (4K 240Hz, FHD 480Hz), 0.03ms, G-SYNC Compatible, Custom Heatsink, AI Gaming, 99% DCI-P3,True 10-bit, USB-C 90W, 3yr Warranty

(192)
$1,399.99
FREE delivery Sat, Jan 3
50+ bought in past month
Loading...
Asus TUF Gaming 27” 1080P Monitor (VG279QL3A) - Full HD, 180Hz, 1ms, Fast IPS, Extreme Low Motion Blur, FreeSync Premium, G-SYNC Compatible, Speakers, DisplayPort, Height Adjustable, 3 Year Warranty

Asus TUF Gaming 27” 1080P Monitor (VG279QL3A) - Full HD, 180Hz, 1ms, Fast IPS, Extreme Low Motion Blur, FreeSync Premium, G-SYNC Compatible, Speakers, DisplayPort, Height Adjustable, 3 Year Warranty

(8,356)
$179.99$167.39
FREE delivery Sun, Jan 4Only 1 left in stock.
100+ bought in past month
Loading...
MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

(1,034)
$1,749.36
Loading...
RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

(18)
$466.03$457.88
FREE delivery Feb 17 - 19
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27
Loading...
MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

(1,034)
$1,749.36
Loading...
RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

(18)
$466.03$457.88
FREE delivery Feb 17 - 19
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27
Loading...
MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

MSI GAMING GeForce RTX 2060 6GB GDRR6 192-bit HDMI/DP Ray Tracing Turing Architecture VR Ready Graphics Card (RTX 2060 GAMING Z 6G)

(1,034)
$1,749.36
Loading...
RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

RTX 2060 8GB Super Graphics Card 256Bit GDDR6 Video Card with Ray Tracing, Dual Fans, PCI Express x 16 3.0 HDMI Display Port DVI, Supports Up to 8K for PC Gaming Office Creative Work

(18)
$466.03$457.88
FREE delivery Feb 17 - 19
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27