Signed Distance Functions & Ray-Marching

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 35

  • @MusicEngineeer
    @MusicEngineeer ปีที่แล้ว +17

    Thank you. This may be very helpful for writing graphics rendering code.

    • @sumandproduct
      @sumandproduct  ปีที่แล้ว +7

      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.

  • @Roxor128
    @Roxor128 ปีที่แล้ว +12

    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  ปีที่แล้ว +4

      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 ปีที่แล้ว

      @@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  ปีที่แล้ว

      @@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 ปีที่แล้ว +3

      @@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  ปีที่แล้ว

      @@bigfloppa9220 Oh, that makes sense, yes. Thank you!

  • @jurgenrichter-gebert
    @jurgenrichter-gebert ปีที่แล้ว +5

    WOW. Very smooth....Next Level! Literally!

  • @johnchessant3012
    @johnchessant3012 ปีที่แล้ว +5

    Great video!

  • @ryanjbuchanan
    @ryanjbuchanan ปีที่แล้ว +6

    Very well made video 😄

  • @jamesgayfer14
    @jamesgayfer14 5 หลายเดือนก่อน +1

    S tier video 👏 Thank you!

  • @shadow15kryans23
    @shadow15kryans23 ปีที่แล้ว +6

    This is a good video 👏

    • @CompanionCube
      @CompanionCube ปีที่แล้ว +1

      This is a good comment 👏

  • @cadenmccorvey4153
    @cadenmccorvey4153 10 หลายเดือนก่อน +1

    amazing video and extremely informative!

  • @VRchitecture
    @VRchitecture ปีที่แล้ว +2

    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.

  • @torikenyon
    @torikenyon ปีที่แล้ว +5

    I’m confused, is just a different way to write the dot product, or is it something different?

  • @oncedidactic
    @oncedidactic ปีที่แล้ว +1

    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.

  • @ValkyRiver
    @ValkyRiver ปีที่แล้ว +2

    How does ray marching work in spherical or hyperbolic geometries?

    • @sumandproduct
      @sumandproduct  ปีที่แล้ว

      I imagine it works similarly whenever you have a metric.

  • @alexandersedykh9280
    @alexandersedykh9280 หลายเดือนก่อน

    Why do we need to calculate the minimum distance to an object that is not located exactly in the direction of the ray?

    • @sumandproduct
      @sumandproduct  25 วันที่ผ่านมา

      Because in general, we don't know which objects lie in the direction we are looking. We can do a step before by looking at the "axes-aligned bounding box". This so-called AABB is the smallest box containing the object. We can intersect the ray with these boxes to check which objects are even candidates for a full intersection check. But in some way or another, we have to look at all objects.

  • @starplatinum3305
    @starplatinum3305 5 หลายเดือนก่อน +1

    how to do collisions tho ? you have source for that ?

    • @sumandproduct
      @sumandproduct  5 หลายเดือนก่อน +1

      I have nothing on hand, as I don't use it much for physics. (Except sphere-vs-SDF, which is automatic.) But there's a new paper, which looks interesting: doi.org/10.1016/j.cagd.2024.102305
      Haven't had time yet to read it, though.

  • @thecritiquer9407
    @thecritiquer9407 ปีที่แล้ว +21

    finally a french competitor to 3blue1browm

    • @jurgenrichter-gebert
      @jurgenrichter-gebert ปีที่แล้ว

      @@markusa.stokkenes2271 He IS German ;-)

    • @notwithouttext
      @notwithouttext ปีที่แล้ว +1

      @@w花b no they mean the COMPETITOR is french not the competitor's VIDEO

    • @notwithouttext
      @notwithouttext ปีที่แล้ว +7

      although, i think they're german, since the channel is in germany

    • @ArnaudMEURET
      @ArnaudMEURET ปีที่แล้ว +2

      Doesn’t sound French at all. German. France produced Fabrice Bellard and that’s enough for a few centuries 😅