Tap to unmute

The SDF of a Line Segment

  Рет қаралды 95,338

Inigo Quilez

Inigo Quilez

Күн бұрын

Пікірлер: 106
@xotmatrix
@xotmatrix 5 жыл бұрын
That last bit, the extrusion, blew my mind.
@AnonimousFuzz
@AnonimousFuzz 5 жыл бұрын
That transition to 3D at 5:25 was so smooth. You're truly a great teacher and getting super good at making informative videos Iñigo! Keep it up, can't wait to see what you do next. :)
@oldcowbb
@oldcowbb 2 жыл бұрын
benefit of being an expert in computer graphic
@timwhite1783
@timwhite1783 4 жыл бұрын
This channel deserves so much more attention than it's getting...
@VisionOf89
@VisionOf89 3 жыл бұрын
The insights per second rating of this video is off the charts.
@Saturos02
@Saturos02 5 жыл бұрын
I was literally just reading about this stuff, what perfect timing! These presentations are seriously the most elegant I've ever seen. Keep up the good work!
@wsricardo23
@wsricardo23 2 жыл бұрын
Where You reading?
@sebastiendubourg4797
@sebastiendubourg4797 4 жыл бұрын
Hi, just a huge thanks for making these. These kind of resources on the web are often way too "mathematical" (too fast, with too many "implied" shortcuts). You managed to make it sound very clear. Also, HUGE bravo to integrating the actual examples/rendering. Finally, this is a 7min long video, which is perfect ! Not too short/fast, not too long/digressing. In a word : thank you. And keep these coming (please) :)
@xbzq
@xbzq 5 жыл бұрын
Excellent again. I'm impressed by how you used your ladybug shader and seamlessly transitioned to the exploded primitives. Very informative and illuminating. One thing: You could render your videos at 4k for even better visuals, if this doesn't clash with your render schedule, hard drive space or upload time, of course. 4k monitors are pretty cheap these days and doing what you do, you should definitely have one, so get one if you don't have one yet. That said, 4k is a decidedly _minor_ quality improvement for your videos as your videos are technically exquisite, something the mere quadrupling of pixels cannot compete with.
@InigoQuilez
@InigoQuilez 5 жыл бұрын
My main workbmonitor is 4k. My webcam (for the hand writing stuff) and phone do 1080p only though, so I assumed that doing 4k just for the CG elements while the rrst is 1080p wouldn't pay off. I can give it a try though and see what it looks like.
@shadespirit11
@shadespirit11 Жыл бұрын
Had I known you could do all of these cool stuff with numbers, I would've taken my math class more seriously. Thank you for this treat!
@MadaraAzukar
@MadaraAzukar 15 күн бұрын
Real
@andrewjhaman
@andrewjhaman 5 жыл бұрын
wow that last section blew my mind. very cool!
@rendermanpro
@rendermanpro 5 жыл бұрын
You definetely can make some cources "Math for CG", you are great on explaining complex things in an easy way
@motbus3
@motbus3 4 жыл бұрын
Yes. Inigo explains content amazingly well and sometimes I need to pause his videos and google stuff to remember. Math for CG would be awesome. This one I would be happy to contribute on patreon.
@realcygnus
@realcygnus 5 жыл бұрын
Priceless content imo.
@PenguinMaths
@PenguinMaths 4 жыл бұрын
I just found this channel and I'm amazed at the quality of your content! I'm so excited to watch more of these videos, thanks for making them!
@truhlikfredy
@truhlikfredy 3 жыл бұрын
The statement about the 4:00, modern HW strictly depends on the target architecture, for example using some modern, but low-end 8-bit RISC CPU will very likely end up doing it as branching (as most likely IEEE754 will be software emulated on it anyway). But reducing branching is not just a feat of CISC x86, small RISC CPUs still might be able to do it directly just it will specifically depend on which architecture they use. For example RISC-V RV32IMF CPU would have dedicated instruction for min and max (fmin.s and fmax.s) even when it's not perfectly IEEE754 standard as extra exception IEEE754 checks would have to be made in SW, in practice you would probably check for NaN inputs on top of the SDF, make sure you wouldn't cause the NaN to be generated in the algorithm and then wouldn't have to do the checks on every single min/max etc.... Again these are architecture specific, RV32IMF will do it without braching, RV32IM will implement it as branching. Overall using min/max is best way to deal with this even when it doesn't guarantee removal of branching on all target architectures. And to go further very likely toolchain can recognize the simple if condition and if it can be implement through min/max then it will use it instead anyway. In generally one side it's good on high level to not bother about micro-optimisations on low-level, but in rendering and other types of applications still knowing bit about the low-level helps making better 'design' desitions on the high level.
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
Very nice explanation and visualizations!
@InigoQuilez
@InigoQuilez 5 жыл бұрын
Thanks man!
@shau4744
@shau4744 5 жыл бұрын
Great explanation. I like the format of these tutorials
@ThibsWorkshop
@ThibsWorkshop 4 жыл бұрын
you are a wizard of maths and computations
@dgobera
@dgobera 2 жыл бұрын
Thanks!
@weirdconstructor2810
@weirdconstructor2810 5 жыл бұрын
This was a really great video! Thanks a lot for sharing this knowledge in such refined and well developed form!
@emteiks
@emteiks 4 жыл бұрын
Thank you! Please create more such short clips on SDF - this is mind blowing and amazing
@iaobardar3452
@iaobardar3452 5 жыл бұрын
Thank you for making this video. I like the way to present these things, especially when you started talking about the extrusions. I just figured out the dot product, and so when I saw it, I totally understood what you were doing. Seeing you explain the equations makes total sense, they seem so cryptic on your website.
@coleraby
@coleraby 5 жыл бұрын
Magnificent as usual, iq!
@michaelzlprime
@michaelzlprime Жыл бұрын
Amazing presentation!
@paemox
@paemox 4 жыл бұрын
Amazing! It would be nice to have a video about the capsule capIntersect() function.
@Somethingsomethinglol
@Somethingsomethinglol 4 жыл бұрын
At 4:59, the capsule is made wavy by the equation: d` = d - (a + b * sin(8 * PI * h)) What are 'a' and 'b' in this equation?
@InigoQuilez
@InigoQuilez 4 жыл бұрын
They are arbitrary valued parameters, they control the amplitude of the oscillations (b, since it's multiplying the sin wave) and how far from the spine of the line they are located (a, since it's being added to the sine wave).
@Somethingsomethinglol
@Somethingsomethinglol 4 жыл бұрын
@@InigoQuilez Makes total sense. You are amazing btw!
@PawelGrzelak
@PawelGrzelak 5 жыл бұрын
This is beautifully done.
@phoboss950
@phoboss950 3 жыл бұрын
Could you please do one of these for the Bezier curve sdf
@CharlesFormanWonderUnit
@CharlesFormanWonderUnit 5 жыл бұрын
So good! What is your workflow for tracking the camera movements?
@InigoQuilez
@InigoQuilez 5 жыл бұрын
After Effects' default camera tracking. I then pass the camera matrix to my Shadertoy plugin and the rest is regular (and realtime!) shader based raymarching and rendering.
@servv3167
@servv3167 2 жыл бұрын
what an amazing human -
@DepressedNOF
@DepressedNOF 4 жыл бұрын
Thanks for this. This will probably save me somuch rendertime.
@NonTwinBrothers
@NonTwinBrothers 3 жыл бұрын
God I love these videos
@miktilk4818
@miktilk4818 5 жыл бұрын
That. Was. Awesome.
@ChenHuang
@ChenHuang 5 жыл бұрын
That sketch in the beginning reminds me of Casey's GJK talk very much, voronoi regions!
@PawanChopraasr
@PawanChopraasr 3 жыл бұрын
Whats the document camera u r using? Thanks for the video
@wsricardo23
@wsricardo23 2 жыл бұрын
There are articles or books about this topic? Where I find more informations about SDFs.
@krejcivaclav
@krejcivaclav 4 жыл бұрын
This is gold.
@InigoQuilez
@InigoQuilez 4 жыл бұрын
Thanks!
@StridBR
@StridBR 5 жыл бұрын
Amazing, thanks for sharing.
@alejmc
@alejmc 5 жыл бұрын
Blown. Question, we treat the equation as if it were from the origin then? As in, we somehow transform the point p from where it’s being evaluated in world space to a local space? Or it was only for explanation purposes? Great vid, thanks a lot.
@o_o............
@o_o............ 5 жыл бұрын
Stunning.
@JeanPierreSchnyder
@JeanPierreSchnyder 5 жыл бұрын
Sorry for my silly question, but what does SDF means in maths ?
@robotics_and_stuff
@robotics_and_stuff 5 жыл бұрын
en.wikipedia.org/wiki/Signed_distance_function
@Teturarsyra
@Teturarsyra 5 жыл бұрын
In short: Signed Distance Field -> a function that returns for any point in 3D space the distance to the nearest surface. Signed because it's usually negative inside the surface.
@AlexTuduran
@AlexTuduran 2 жыл бұрын
Inigo, do you think it's possible to convert an arbitrary standard 3D geometry model to a single composition of SDFs and vice-versa? And I don't mean SDFs represented as 3D volume textures, but actual SD functions aggregated into a single giant SDF composite, hence an analytical representation. I think the usefulness of such a tool speaks for itself.
@sabrango
@sabrango 4 жыл бұрын
Great job!
@JuanPabloCarbajal
@JuanPabloCarbajal 4 жыл бұрын
The distance d in the paper-formula is an absolute value, but the code implementation can return negative values. What's the expected domain of the returned d? shall it be allowed to take negative values? I understand that the sign could be exploited to differentiate internal points from external points, is it the idea?
@jobigoud
@jobigoud 3 жыл бұрын
Yes, it tells if the point is inside or outside the surface.
@prayash
@prayash 5 жыл бұрын
This is arcane wizardry
@richardramirez5746
@richardramirez5746 7 ай бұрын
I see Inigo Quilez name everywhere... Now, I understand why. I must ask, which software you used for this 3d creations?
@InigoQuilez
@InigoQuilez 6 ай бұрын
I use shadertoy.com for thr bulk of it (so GLSL) and a bit of C++ on top.
@Smeebit
@Smeebit 3 күн бұрын
How does this work in 3D? I don't get it. I copied the math in blender nodes, and it works wonders in 2D. But 3D? Not so much. Making an SDF sphere in Blender nodes is easy. You project the position of the scene onto a flat plane. The plane oriented to the camera. And then get the distance to a point on the plane. When creating the line segment, I used 2 points on the same projected plane. It looks good from the side. But looking from one of the ends, you notice there is no perspective. The whole line scales to the radius of point A. When point A is close to the camera, then the whole line is big. When point A is far from the camera, then the whole line is small. The problem is that I did all the math on the plane of point A. I can't think how not to. Because if I use both planes of point A and B, then the math favors Point A. Making Point A always visible, but Point B phases in and out. I'm afraid I've made a fundamental mistake, but I don't know what. I've rewatched the video a dozen times, and I don't understand how you get 3D results from this. I'd really appreciate some help or insight.
@ac12484
@ac12484 4 жыл бұрын
Mind blown! I assume you work in CG full time?
@nano_redstone
@nano_redstone 5 жыл бұрын
I can't seem to find a video that explains the importance of Minimizing the branching can someone explain it briefly or point out a ressource that will do it?
@antonkapelyushnik47
@antonkapelyushnik47 5 жыл бұрын
GPU will "perform" both branches by group of threads. Even if it is false branch. So, you just waisting resources. It is price for parallelism. Google "lockstep gpu branching"
@jaa70
@jaa70 3 жыл бұрын
Thanks, I am starting with SDF for fluid interface dynamic, can you pass me a good book to start? I'm physicist and I've made simulations before with steady boundaries. This is a new world for me.
@shifter65
@shifter65 3 жыл бұрын
Quick question. For the modulation how do you get a float value (d') from multiplying a vec (a,b)?
@InigoQuilez
@InigoQuilez 3 жыл бұрын
In d' = d - (a+b*4*h*(1-h)+c*cos(10*h+4*time)+... al constants a, b, c, ... are scalars (float values)
@shifter65
@shifter65 3 жыл бұрын
@@InigoQuilez a and b are not vertices? Or are they unrelated to a,b,h in the diagram?
@InigoQuilez
@InigoQuilez 3 жыл бұрын
@@shifter65 They are unrelated. Uppercases are vectors, lowercase is escalars.
@shifter65
@shifter65 3 жыл бұрын
@@InigoQuilez Oh, i see! Is h also unrelated?
@shifter65
@shifter65 3 жыл бұрын
Or is it the same value we calculate from the projection?
@ludensregisluciscaelum7636
@ludensregisluciscaelum7636 5 жыл бұрын
Hola Inigo, gracias por el contenido y explicacion, espero que subas mas videos. Me gustaria preguntarte: que tarjeta de video GPU/CPU, RAM, etc, tienes en tu PC para animaciones y rendering? Saludos!
@InigoQuilez
@InigoQuilez 5 жыл бұрын
Hola. Tengo in laptop Asus con 8GB de RAM, con una GeForce 1070 Mobile.
@wandeson3205
@wandeson3205 4 жыл бұрын
Suggestion reading about this topic SDF please.
@InigoQuilez
@InigoQuilez 4 жыл бұрын
Not a good introduction, but once you are a bit familiar with SDFs, you can read this too: iquilezles.org/www/articles/raymarchingdf/raymarchingdf.htm
@4arliEdinorog
@4arliEdinorog 4 жыл бұрын
Потрясающе
@maythesciencebewithyou
@maythesciencebewithyou 2 жыл бұрын
You are a true math wizard
@XeroOl
@XeroOl 5 жыл бұрын
I can't believe I didn't see this earlier
@simivb
@simivb 5 жыл бұрын
From watching your videos, I get the impression that SDF seem to have many advantages over triangulation. Why is it not used broadly? (Or is it and I just don't know?). Do we not have an efficient way to render them, like triangles?
@Kino-Imsureq
@Kino-Imsureq 3 жыл бұрын
on some potato computers like mine its way laggier to do however advantages are that you dont really need to worry about LOD. And you can also do pathtracing easily.
@zechordlord
@zechordlord 5 жыл бұрын
Very good!
@harrysvensson2610
@harrysvensson2610 4 жыл бұрын
What exactly does SDF stand for? Google shows weird stuff and it's never really being explained in the video or in the video description.
@InigoQuilez
@InigoQuilez 4 жыл бұрын
It's Signed Distance Fields : www.iquilezles.org/www/articles/raymarchingdf/raymarchingdf.htm
@xanthirudha
@xanthirudha 5 жыл бұрын
WOW what tools are used for such animations on the paper
@NikolaNevenov86
@NikolaNevenov86 5 жыл бұрын
he mentioned in a stream that he uses a After Effects script that lets him use his shadertoy shaders inside after effects, and somehow composit them.
@InigoQuilez
@InigoQuilez 5 жыл бұрын
@@NikolaNevenov86 That's exactly right. I just use Shadertoy to do all the visuals and glue them to the webcam footage with After Effects
@learningchanneru4856
@learningchanneru4856 3 жыл бұрын
this is cool 👍👍👍👍👍
@barelyrendered6254
@barelyrendered6254 4 жыл бұрын
The background music makes it hard to hear you.
@alijayameilio
@alijayameilio 5 жыл бұрын
Wow... How can you integrate camera tracking data into your shader? This is great tho XD
@InigoQuilez
@InigoQuilez 5 жыл бұрын
Hi. I responded in some other comment above or below this one. But basically I get it from After Effects and I pass it in a matrix.
@alijayameilio
@alijayameilio 5 жыл бұрын
@@InigoQuilez wow... That's really great :D... Thank for making such a great content XD
@aperson4051
@aperson4051 5 жыл бұрын
What is SDF?
@derek7808
@derek7808 5 жыл бұрын
A Person I had the same question and found signed distance function en.wikipedia.org/wiki/Signed_distance_function
@rendermanpro
@rendermanpro 5 жыл бұрын
Signed Distance Field developer.nvidia.com/gpugems/gpugems3/part-v-physics-simulation/chapter-34-signed-distance-fields-using-single-pass-gpu
@InigoQuilez
@InigoQuilez 5 жыл бұрын
More (practical info) in my website. Download the PDF in the link in the article: www.iquilezles.org/www/material/nvscene2008/nvscene2008.htm
@swampflux
@swampflux 5 жыл бұрын
Amazing
@ziyunsong562
@ziyunsong562 3 жыл бұрын
i will donate on alipay,i dont have paypal
@InigoQuilez
@InigoQuilez 3 жыл бұрын
Is it allpay.net or allpaid.com or some other? I'm just curious in general to know which one it is that allows for exchange between mainland china and the west.
@Ganerrr
@Ganerrr 2 жыл бұрын
I gotta get better at this stuff lol, my first and second versions were way slower running than yours
@rendermanpro
@rendermanpro 5 жыл бұрын
Deriving the SDF of a Line Segment - 1 dislike Rounding Corners in SDFs - 1 dislike Deriving the SDF of a Box - 1 dislike ....ahaha, who is that one the same guy? :D ...1000 likes and 1 dislike. Probably someone miss button
@stana1980
@stana1980 2 жыл бұрын
Great video could you please mention which software you used to make math into 3d is it Unreal engine /Unity or something else Thanks for the tutorial Jesus loves you
@InigoQuilez
@InigoQuilez 2 жыл бұрын
I use shadertoy.com. You have a link to the painting in the description of the video.
@christopherchang6378
@christopherchang6378 4 жыл бұрын
you're a fuckin' genius, but i'm sure you know that xD
@dgoberna
@dgoberna 5 жыл бұрын
canela
@TheVBounce
@TheVBounce 3 жыл бұрын
If you turn off the background music it would help a lot
@vincentcleaver1925
@vincentcleaver1925 2 жыл бұрын
You say line segment, but the pill shape is 3D... Hmm
@InigoQuilez
@InigoQuilez 2 жыл бұрын
A line segments is a straight line connecting two points in 3D. Or in 2D, or any number of dimensions.
Painting a Landscape with Maths
42:00
Inigo Quilez
Рет қаралды 722 М.
Signed Distance Functions & Ray-Marching
24:14
Sum and Product
Рет қаралды 33 М.
JISOO - ‘꽃(FLOWER)’ M/V
3:05
BLACKPINK
Рет қаралды 137 МЛН
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
The clever way curvature is described in math
16:17
Mathemaniac
Рет қаралды 104 М.
Rounding Corners in SDFs
4:55
Inigo Quilez
Рет қаралды 73 М.
introduction to Signed Distance Fields
10:16
chris biscardi
Рет қаралды 14 М.
Painting a Character with Maths
24:46
Inigo Quilez
Рет қаралды 420 М.
The Most Mind-Blowing Aspect of Circular Motion
18:35
All Things Physics
Рет қаралды 751 М.
Bresenham's Line Algorithm - Demystified Step by Step
16:10
NoBS Code
Рет қаралды 67 М.
The Collatz Conjecture and Fractals
10:53
Inigo Quilez
Рет қаралды 86 М.
Visualizing 4D Pt.1
22:56
HyperCubist Math
Рет қаралды 1,2 МЛН
What is algebraic geometry?
11:50
Aleph 0
Рет қаралды 228 М.
The Math Behind Font Rasterization | How it Works
16:07
GamesWithGabe
Рет қаралды 173 М.
JISOO - ‘꽃(FLOWER)’ M/V
3:05
BLACKPINK
Рет қаралды 137 МЛН