The SDF of a Line Segment

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 104

  • @xotmatrix
    @xotmatrix 4 года назад +88

    That last bit, the extrusion, blew my mind.

  • @AnonimousFuzz
    @AnonimousFuzz 4 года назад +70

    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

  • @VisionOf89
    @VisionOf89 3 года назад +3

    The insights per second rating of this video is off the charts.

  • @timwhite1783
    @timwhite1783 4 года назад +13

    This channel deserves so much more attention than it's getting...

  • @sebastiendubourg4797
    @sebastiendubourg4797 4 года назад +15

    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) :)

  • @Saturos02
    @Saturos02 4 года назад +27

    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!

  • @shadespirit11
    @shadespirit11 Год назад +2

    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!

  • @rendermanpro
    @rendermanpro 4 года назад +40

    You definetely can make some cources "Math for CG", you are great on explaining complex things in an easy way

    • @motbus3
      @motbus3 4 года назад +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.

  • @andrewjhaman
    @andrewjhaman 4 года назад +7

    wow that last section blew my mind. very cool!

  • @xbzq
    @xbzq 4 года назад +18

    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  4 года назад +8

      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.

  • @realcygnus
    @realcygnus 4 года назад +7

    Priceless content imo.

  • @ThibsWorkshop
    @ThibsWorkshop 4 года назад

    you are a wizard of maths and computations

  • @PenguinMaths
    @PenguinMaths 4 года назад +1

    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!

  • @TheArtofCodeIsCool
    @TheArtofCodeIsCool 4 года назад +2

    Very nice explanation and visualizations!

  • @shau4744
    @shau4744 4 года назад +1

    Great explanation. I like the format of these tutorials

  • @emteiks
    @emteiks 4 года назад

    Thank you! Please create more such short clips on SDF - this is mind blowing and amazing

  • @weirdconstructor2810
    @weirdconstructor2810 4 года назад +1

    This was a really great video! Thanks a lot for sharing this knowledge in such refined and well developed form!

  • @iaobardar3452
    @iaobardar3452 4 года назад

    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.

  • @michaelzlprime
    @michaelzlprime Год назад

    Amazing presentation!

  • @coleraby
    @coleraby 4 года назад +1

    Magnificent as usual, iq!

  • @paemox
    @paemox 4 года назад +1

    Amazing! It would be nice to have a video about the capsule capIntersect() function.

  • @PawelGrzelak
    @PawelGrzelak 4 года назад

    This is beautifully done.

  • @servv3167
    @servv3167 2 года назад

    what an amazing human -

  • @DepressedNOF
    @DepressedNOF 4 года назад

    Thanks for this. This will probably save me somuch rendertime.

  • @miktilk4818
    @miktilk4818 4 года назад +1

    That. Was. Awesome.

  • @truhlikfredy
    @truhlikfredy 2 года назад +1

    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.

  • @NonTwinBrothers
    @NonTwinBrothers 3 года назад +2

    God I love these videos

  • @o_o............
    @o_o............ 4 года назад

    Stunning.

  • @krejcivaclav
    @krejcivaclav 4 года назад

    This is gold.

  • @ChenHuang
    @ChenHuang 4 года назад

    That sketch in the beginning reminds me of Casey's GJK talk very much, voronoi regions!

  • @4arliEdinorog
    @4arliEdinorog 4 года назад +1

    Потрясающе

  • @StridBR
    @StridBR 4 года назад

    Amazing, thanks for sharing.

  • @dgobera
    @dgobera 2 года назад

    Thanks!

  • @sabrango
    @sabrango 4 года назад

    Great job!

  • @maythesciencebewithyou
    @maythesciencebewithyou 2 года назад

    You are a true math wizard

  • @phoboss950
    @phoboss950 2 года назад +1

    Could you please do one of these for the Bezier curve sdf

  • @CharlesFormanWonderUnit
    @CharlesFormanWonderUnit 4 года назад +5

    So good! What is your workflow for tracking the camera movements?

    • @InigoQuilez
      @InigoQuilez  4 года назад +15

      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.

  • @PawanChopraasr
    @PawanChopraasr 3 года назад

    Whats the document camera u r using? Thanks for the video

  • @zechordlord
    @zechordlord 4 года назад

    Very good!

  • @swampflux
    @swampflux 4 года назад

    Amazing

  • @wsricardo23
    @wsricardo23 2 года назад

    There are articles or books about this topic? Where I find more informations about SDFs.

  • @alejmc
    @alejmc 4 года назад +1

    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.

  • @Somethingsomethinglol
    @Somethingsomethinglol 4 года назад +1

    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 года назад +2

      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!

  • @learningchanneru4856
    @learningchanneru4856 3 года назад

    this is cool 👍👍👍👍👍

  • @XeroOl
    @XeroOl 4 года назад +1

    I can't believe I didn't see this earlier

  • @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.

  • @JeanPierreSchnyder
    @JeanPierreSchnyder 4 года назад +2

    Sorry for my silly question, but what does SDF means in maths ?

    • @robotics_and_stuff
      @robotics_and_stuff 4 года назад +1

      en.wikipedia.org/wiki/Signed_distance_function

    • @Teturarsyra
      @Teturarsyra 4 года назад +1

      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.

  • @ac12484
    @ac12484 4 года назад

    Mind blown! I assume you work in CG full time?

  • @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.

  • @wandeson3205
    @wandeson3205 3 года назад

    Suggestion reading about this topic SDF please.

    • @InigoQuilez
      @InigoQuilez  3 года назад

      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

  • @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.

  • @prayash
    @prayash 4 года назад +3

    This is arcane wizardry

  • @Ganerrr
    @Ganerrr 2 года назад

    I gotta get better at this stuff lol, my first and second versions were way slower running than yours

  • @richardramirez5746
    @richardramirez5746 5 месяцев назад +1

    I see Inigo Quilez name everywhere... Now, I understand why. I must ask, which software you used for this 3d creations?

    • @InigoQuilez
      @InigoQuilez  4 месяца назад

      I use shadertoy.com for thr bulk of it (so GLSL) and a bit of C++ on top.

  • @ludensregisluciscaelum7636
    @ludensregisluciscaelum7636 4 года назад

    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  4 года назад

      Hola. Tengo in laptop Asus con 8GB de RAM, con una GeForce 1070 Mobile.

  • @barelyrendered6254
    @barelyrendered6254 4 года назад +1

    The background music makes it hard to hear you.

  • @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 года назад +1

      Yes, it tells if the point is inside or outside the surface.

  • @nano_redstone
    @nano_redstone 4 года назад

    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 4 года назад +2

      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"

  • @simivb
    @simivb 4 года назад

    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.

  • @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

  • @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?

  • @xanthirudha
    @xanthirudha 4 года назад

    WOW what tools are used for such animations on the paper

    • @NikolaNevenov86
      @NikolaNevenov86 4 года назад +1

      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  4 года назад +1

      @@NikolaNevenov86 That's exactly right. I just use Shadertoy to do all the visuals and glue them to the webcam footage with After Effects

  • @alijayameilio
    @alijayameilio 4 года назад

    Wow... How can you integrate camera tracking data into your shader? This is great tho XD

    • @InigoQuilez
      @InigoQuilez  4 года назад +1

      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 4 года назад

      @@InigoQuilez wow... That's really great :D... Thank for making such a great content XD

  • @aperson4051
    @aperson4051 4 года назад +1

    What is SDF?

    • @derek7808
      @derek7808 4 года назад

      A Person I had the same question and found signed distance function en.wikipedia.org/wiki/Signed_distance_function

    • @rendermanpro
      @rendermanpro 4 года назад

      Signed Distance Field
      developer.nvidia.com/gpugems/gpugems3/part-v-physics-simulation/chapter-34-signed-distance-fields-using-single-pass-gpu

    • @InigoQuilez
      @InigoQuilez  4 года назад

      More (practical info) in my website. Download the PDF in the link in the article: www.iquilezles.org/www/material/nvscene2008/nvscene2008.htm

  • @rendermanpro
    @rendermanpro 4 года назад

    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 года назад +1

      I use shadertoy.com. You have a link to the painting in the description of the video.

  • @dgoberna
    @dgoberna 4 года назад

    canela

  • @christopherchang6378
    @christopherchang6378 4 года назад

    you're a fuckin' genius, but i'm sure you know that xD

  • @TheVBounce
    @TheVBounce 2 года назад

    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.