Signed Distance Functions & Ray-Marching

  Рет қаралды 26,494

Sum and Product

Sum and Product

Күн бұрын

Tell me how far away something is, and I tell you what it looks like!
This one took a while. Mostly due to other things in my life. But also because I stumbled over quite a few problems when trying to implement SDFs for the animation. As a consequence, I learned more, but I also had to rewrite the script a lot to convey the things I learned properly. Still feels much rougher around the edges than my other videos.
Moreover, this video is in 4k and 60 fps. Is it worth it? Doesn't make the development of the video much longer, so, I'll probably continue with it...
Lastly, this video is also my submission for the Summer of Math Exposition 2023. If you search for #SoME3 on KZbin, you will find many fantastic videos by the other participants!
--------------------
Join the Sum and Product Discord:
/ discord
Follow Sum And Product on Twitter:
/ sumandproduct
...or Instagram:
/ sum_and_product
Or buy me a coffee:
ko-fi.com/sumandproduct
--------------------
Resources, references & further reading material:
Animations were made with CindyJS:
cindyjs.org/
Signed Distance Functions on Wikipedia:
en.wikipedia.org/wiki/Signed_...
Octrees on Wikipedia:
en.wikipedia.org/wiki/Octree
Calculating perpendiculars via dot product:
en.wikipedia.org/wiki/Vector_...
Inigo Quilez' Website:
iquilezles.org/
Inigo Quilez' KZbin channel:
/ @inigoquilez
Inigo Quilez' article on wrong interior SDFs when using mimimums:
iquilezles.org/articles/inter...
Giovanni Russo & Smereka (2000), A Remark on Computing Distance Functions:
www.sciencedirect.com/science...
Phong reflection on Wikipedia:
en.wikipedia.org/wiki/Phong_r...
Blog post by Vassilis Poulopoulos on how to use SDFs to render text:
renderdiagrams.org/2017/12/28...
Music:
"Shade" by Josh Woodward. Free download: joshwoodward.com/
--------------------
Chapters:
[00:00] Introduction
[01:36] Ray-Marching
[04:51] Definition & Calculations
[14:25] Manipulating SDFs
[18:53] Basic Lighting & Actual Rendering

Пікірлер: 33
@jamesgayfer14
@jamesgayfer14 10 күн бұрын
S tier video 👏 Thank you!
@MusicEngineeer
@MusicEngineeer 10 ай бұрын
Thank you. This may be very helpful for writing graphics rendering code.
@sumandproduct
@sumandproduct 10 ай бұрын
I hope it will! When actually coding this, there are dozens of edge cases and practical problems to solve. But I hope that at least the mathematical foundation was made clear in the video.
@jurgenrichter-gebert
@jurgenrichter-gebert 10 ай бұрын
WOW. Very smooth....Next Level! Literally!
@sumandproduct
@sumandproduct 10 ай бұрын
Thank you very much! 😄
@VRchitecture
@VRchitecture 9 ай бұрын
Lovely introduction! It’s nice you not only mentioned what SDFs are but also derived a couple of basics ones 👏🏻 P.S. Though ray marching usage is pretty rare, typically we render “pre-baked” 3D geometry (stored as a list of vertices and normals not its mathematical description) with some sort of ray tracing.
@cadenmccorvey4153
@cadenmccorvey4153 5 ай бұрын
amazing video and extremely informative!
@ryanjbuchanan
@ryanjbuchanan 10 ай бұрын
Very well made video 😄
@johnchessant3012
@johnchessant3012 10 ай бұрын
Great video!
@sumandproduct
@sumandproduct 10 ай бұрын
Thank you!
@shadow15kryans23
@shadow15kryans23 10 ай бұрын
This is a good video 👏
@CompanionCube
@CompanionCube 9 ай бұрын
This is a good comment 👏
@Roxor128
@Roxor128 10 ай бұрын
Ray-marching for collision-detection? Sounds useful. How to handle the different shapes of the objects involved, though? Could be a topic for a new video.
@sumandproduct
@sumandproduct 10 ай бұрын
I've only used it for simple physics simulations where the objects moving around are small circles. But it's probably worth looking into more...
@Roxor128
@Roxor128 10 ай бұрын
@@sumandproduct Yeah, I can see how you'd do sphere-anything collision. Subtract the sphere's radius from the SDF of whatever it might hit and then ray-march the same as if you're rendering the scene. Basically, making a rounded box and doing sphere-box collision would be the same process. The real headscratcher is how to handle other shapes and the potential rotation that would be introduced when they collide.
@sumandproduct
@sumandproduct 10 ай бұрын
@@Roxor128 From what I learned during the research for this video, I wouldn't be surprised if checking for collision of two arbitrary SDFs is just not possible.
@bigfloppa9220
@bigfloppa9220 9 ай бұрын
@@sumandproduct it is actually possible, but it requires gradient descent on the sdfs, and likely only works on true sdfs, not ones created using the unions of the shapes. it boils down to reducing the problem to the same one as colliding sphere sdfs, but by solving the system of equations formed by the two sdfs you are colliding. very possible, but time consuming and not very performant, as opposed to using bounding volumes to perform collision detection. There are several papers on it from Nvidia/other graphics researchers, and I think it probably does have it's place in physics simulations
@sumandproduct
@sumandproduct 9 ай бұрын
@@bigfloppa9220 Oh, that makes sense, yes. Thank you!
@oncedidactic
@oncedidactic 8 ай бұрын
Very nice video! I learned a lot of new perspectives. As someone who works with spatial analysis tools on large datasets, I often wonder about how graphics approaches work versus the implementations of basic spatial relationship calculations. There is obviously much conceptual overlap, and I’m curious how many techniques are shared directly.
@torikenyon
@torikenyon 9 ай бұрын
I’m confused, is just a different way to write the dot product, or is it something different?
@sumandproduct
@sumandproduct 9 ай бұрын
It is the dot product!
@udderhippo
@udderhippo 8 ай бұрын
Great video! Unsolicited English tip: pronounce "v" as a hard, sharp sound to differentiate it from the softer rounder "w". Don't be misled by the "v" character! In English it is pronounced like start of "wasser" in German.
@starplatinum3305
@starplatinum3305 Күн бұрын
how to do collisions tho ? you have source for that ?
@ValkyRiver
@ValkyRiver 10 ай бұрын
How does ray marching work in spherical or hyperbolic geometries?
@sumandproduct
@sumandproduct 10 ай бұрын
I imagine it works similarly whenever you have a metric.
@thecritiquer9407
@thecritiquer9407 10 ай бұрын
finally a french competitor to 3blue1browm
@jurgenrichter-gebert
@jurgenrichter-gebert 10 ай бұрын
@@markusa.stokkenes2271 He IS German ;-)
@notwithouttext
@notwithouttext 9 ай бұрын
@@whannabi no they mean the COMPETITOR is french not the competitor's VIDEO
@notwithouttext
@notwithouttext 9 ай бұрын
although, i think they're german, since the channel is in germany
@ArnaudMEURET
@ArnaudMEURET 7 ай бұрын
Doesn’t sound French at all. German. France produced Fabrice Bellard and that’s enough for a few centuries 😅
Introduction to Projective Geometry via Tic-Tac-Toe Grids
21:26
Sum and Product
Рет қаралды 49 М.
Rethinking the real line #SoME3
14:54
Proof of Concept
Рет қаралды 92 М.
The delivery rescued them
00:52
Mamasoboliha
Рет қаралды 10 МЛН
Which one is the best? #katebrush #shorts
00:12
Kate Brush
Рет қаралды 18 МЛН
Пишем свой движок 3D-графики
19:25
Onigiri
Рет қаралды 532 М.
What does a complex function look like? #SoME3
20:38
mathematimpa
Рет қаралды 118 М.
The Art of Linear Programming
18:56
Tom S
Рет қаралды 623 М.
How (and why) to raise e to the power of a matrix | DE6
27:07
3Blue1Brown
Рет қаралды 2,7 МЛН
A very interesting differential equation.
16:28
Michael Penn
Рет қаралды 951 М.
I Made A Blob Shooting Game With Ray Marching
13:33
Visionary 3D
Рет қаралды 36 М.
An introduction to Raymarching
34:03
kishimisu
Рет қаралды 118 М.
The Most Mind-Blowing Aspect of Circular Motion
18:35
All Things Physics
Рет қаралды 668 М.
How Big Budget AAA Games Render Clouds
10:45
SimonDev
Рет қаралды 257 М.
Watching Neural Networks Learn
25:28
Emergent Garden
Рет қаралды 1,2 МЛН