Recursive Ray Tracing - Computerphile

preview_player
Показать описание
Ray Tracing seems straightforward, but what about reflections and refractions? Lewis Stuart explains how these are managed by a spot of recursion!

This video was filmed and edited by Sean Riley.

Рекомендации по теме
Комментарии
Автор

Lewis made a bit of a hash of the pronunciation of Fresnel, so we fixed it in post, gold star if you noticed! -Sean

Computerphile
Автор

"I remember this from 80s because I'm old"
"Yeah"

Lmao

mattymattffs
Автор

As the lead rendering engineer for a VFX studio a couple of points: The reason we use it is not "because it can handle more complex lighting effects", it's because, compared to rasterizing triangles, it suffers less from overdraw, and maintains a O(log2(n)) time complexity for traversal (assuming a binary BVH) compared to rasterization which is more like O(n) in complexity vs the number of objects in the scene. Raytracing, for extremely complex scenes, is often FASTER than rasterization, despite what some people say. For VFX where we render quadrillions of objects, it is the only practical option. In many cases I've tested film-production scale scenes on GPU rasterizer vs CPU raytraced and the CPU implementation was much faster. It's that much better for scene complexity. Another reason we use raytracing is that it gives us a way to physically simulate the path of photons through the scene, and hence use physics equations to run proper physical simulations of light transport. Also, a simpler explanation of the fresnel equations is that they give you the probability of reflected and refracted photons after an interaction with a surface. The algorithm shown here is called "splitting" where you cast both refraction and reflection rays. In modern raytracers used in film production, we don't do this. Instead, we randomly (probabilistically) choose either reflection or refraction, which is what happens in the real world. Real photons choose one option, not both. This reduces the complexity of multi-bounce raytracing since the time-complexity doesn't increase exponentially.

evolutionarytheory
Автор

Writing a raytracer like this one from scratch was one of our university computer science projects. A lot of fun it was.

toby
Автор

In order to know what a recursion is, you must first know what a recursion is

cparsec
Автор

I did a bunch of ray tracing work in the 90s at Uni.
My final project took ~12 hours on my 25MHz Macintosh (after I bought the optional FPU) to render.

I've just now found the source and downloaded PovRay (the same thing I used back then) and on my whatever-it-is-work-laptop it took <1 sec to render the entire scene.

Wow.

Cheers for the inspiration to go revisit this.

mryon
Автор

The voiceover "Frenell" blended in very smooth

HerrLavett
Автор

great to see Blender being used to demonstrate it!

GaryParris
Автор

Great video. The process is so intuitive and straight forward it's remarkable that it works so quite well when it comes to rendering photo-realistic scenes.

cazino
Автор

Early to a Computer graphics computerphile video, my algorithm knows me well

menaced.
Автор

That would be a 4L Distilled Water Storage Container. You are welcome.

GilesBathgate
Автор

I got into scripting PovRay animations in the 90s on my Amiga. I would setup a scene, render a postage stamp sized preview and then set a render to go and it would take two or three days to render a 2 second looping animation. Nobody had seen stuff like we were doing back then. We would project that stuff up in dance parties and music festivals.

NerdENerd
Автор

Yup, I remember coding it back in college in the 1990s. I even remember the textbooks I used: _"Mathematical Elements for Computer Graphics"_ and _"Procedural Elements for Computer Graphics, "_ both by David Rogers _et al._

Sadly, after graduating, I took up a job writing business software. While my career hasn't been bad, I do miss not working on hardcore computer graphics. Every time CG software developers win Oscars, I think _"That could've been me!"_

nHans
Автор

In recursive lingo it's called "unwinding" when the functions go back through each call

patheally
Автор

Yes, I remember Adobe After Effects briefly had Ray tracing in the 2014 edition, but it disappeared in the 2015 version. I was pretty upset at the time.

Edit:
I remember switching to cinema 4d for animations of Infinity boxes and having to learn the lesson of the ultimate importance of the bounce number the hard way. For 4k renders to look in any way realistic, it typically requires upwards of 15 bounces. The processing time per frame was on the order of 20 minutes at the time. This was a fun walk back in time.

rachel_rexxx
Автор

I think the "juggler" demo on the Amiga in 1985/6 (a home computer ) blew most people's minds.

TheSudsy
Автор

I did a little raytracer using distributed raytracing, as described in the 1984 paper from pixar. It was a lot of fun.

rastersoft
Автор

Lewis (and all of us) with bated excitement "omg look at that. It came out in 1976"

A layhuman hears us and then looks at some spheres and triangles and wonders what we're all high on. 🤣

jalsiddharth
Автор

What is being done with the robots in the background? Can we have a video on those?

kenziemckenzie-bennett
Автор

Had a great time writing a ray tracer (recursive) back in ~1992 for graphics class. It was even cooler that we could write it threaded and run it on the SGI servers that had six processors since it's embarrassingly parallel.

shanehebert