How Ray Casting and Sphere Intersection Works // Ray Tracing Series

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

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

  • @TheCherno
    @TheCherno  2 года назад +25

    Hope you all enjoyed this episode, and that the visualization was helpful! Join the episode discussion thread on my Discord in the #raytracing-series channel: discord.gg/thecherno
    And of course for all of your math needs, visit brilliant.org/TheCherno to get started learning STEM for free, and the first 200 people will get 20% off their annual premium subscription.

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

      ;)

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

      27:35 Hahaha didn't expect you'd actually talk about it and prove it! I'm glad I commented my misconception in the previous video, else I'd wouldn't realise it

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

      Also amazing, I've never seen Ray tracing being demonstrated backwards like this!

  • @octaviosilva5808
    @octaviosilva5808 2 года назад +121

    I physically feel my brain cell number increasing with this series

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

      You can't even recall your real name!

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

      Mine can’t yet comprehend. Yours must be very advanced.

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

      @@QuintinMassey Quite plainly. You can't even recall your real name. Seek help,

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

      hahahaha you put my feelings into words

  • @ramoncf7
    @ramoncf7 2 года назад +7

    This raycasting series is the best visualization I've seen online. Thank you for the videos, they've been very useful.

  • @redafakih12
    @redafakih12 2 года назад +7

    You know you made it in life when you start using your own engine to teach people things that you know🤜🏽🤛🏽😂. Mad respect for Cherno, the guy is a legend🔥

  • @oguzhantopaloglu9442
    @oguzhantopaloglu9442 2 года назад +5

    I love how you used Hazel to visualize it!

  • @xmk89
    @xmk89 2 года назад +11

    That's the greatest 3d visualization I've ever seen in this area. Keep going on. Coud you please share what CPU you have ? Any plans to cover other geometrical primitives except spheres?

  • @gwch3481
    @gwch3481 2 года назад +11

    24:20
    The math was so deep, the camera had a hard time staying focused :)

  • @maxmustermann8250
    @maxmustermann8250 2 года назад +5

    Cherno back at it again with the fresh fade 😎

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

    Really fun series and really cool now that we are getting a bit into the meat of it all.
    This showcases what raytraced Rendering actually is. Where basically you are creating an entire image from just rays being thrown around all over the place and then those rays are doing other things to create a perfectly accurate colored pixel.
    All that math and power being thrown around simply to create an accurate final color.
    Can't wait to see how all the bouncing works and then reflections and shadows and RTGI and such like that.
    Are your plans to go through each concept of RT in its own video? Like a video on just reflections and how it all works, just lighting and how RT Lighting works and how exactly RT shadows work or just throw it all into the same video?
    Also look forward to seeing BVHs and the lesson on why RT is so expensive in the end even with these machines that supposedly can perform trillions of FP calculations a second.
    Always cool to see this stuff come to life so to speak

  • @ViniciusMiguel1988
    @ViniciusMiguel1988 2 года назад +2

    I loved this format and pace!

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

    This is kind of blowing my mind.. I was sure raytracing was using more complicated math than just the solution to the quadratic equation, but I can see that it's just building on basic algebraic building blocks. Really great visuals and insights, thanks for sharing.

  • @spectrm6014
    @spectrm6014 2 года назад +2

    You have the best explanations, thank you for these videos, oh and btw, nice hair :)

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

    Love using hazel as a visualization tool. More like this, please 🙏!

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

    Amazing visualization! Love your work Cherno

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

    I post this comment to increase the engagement of this video for RUclips. This series have been amazing so far.

  • @maqabayker
    @maqabayker 2 года назад +2

    Great job! Just a friendly reminder, your camera was focusing on the board at certain points of the video so I hope you can fix that next time.

  • @CP-sr6ml
    @CP-sr6ml 11 месяцев назад

    Might have been worth mentioning that normalizing vectorA translates to "vectorA / sqrt(dot(vectorA, vectorA))". Just because it makes it very clear how normalizing is ofc more work than just taking a dot product. normalizing = dividing each vector component by the square root of the vectors dot product with itself. since the dot product of a vector with itself is inherently it's squared magnitude

  • @akbarisroilov1002
    @akbarisroilov1002 Год назад +1

    why Hazel uses C# instead of C++ ?

  • @kumu2024
    @kumu2024 9 месяцев назад

    Just watching this videos, will not be enough to digest the information :)

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

    Starting to get quite spicy!

  • @chennebicken372
    @chennebicken372 2 года назад +2

    Just with your Maths-(Deep-As-The-Ocean)-video I was able to come up with simple and very bad code using OpenGL (The Basics I learned from your OpenGL Series (Just the first few episodes)). Finally I already have implemented reflections with different reflectabilities and several spheres. The problem is, that my architecture is not scalable at all. Everything is just running in one huge pixel shader. But it works really well and i‘m so excited about, what I was able to do. I really have to thank you for the indepth explanation of everything.

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

      I cannot even program a Tetris game..
      Congratulations

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

      You guys are coding games!? I'm stuck with queues and trees only

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

    So well explained with the code and live visuals side by side

  • @kinkazax
    @kinkazax 11 месяцев назад

    You are very good teacher

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

    Wow hazel seems amazing! I can only hope to become as good as you!

  • @yapayanzeka
    @yapayanzeka 10 месяцев назад

    unbelievable tutorial I've ever seen

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

    this is interesting, i’m curious how you determine the hit position of a more complex shape that’s not mathematically defined?

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

    Loved it, thanks!

  • @samochreno
    @samochreno 2 года назад +11

    Hey cherno, you haven't done a C++ series video in a while, and just wanted to say, if the series is still alive you could make a video on constexpr keyword as you didnt cover that yet

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

      It's so simple..
      The compiler will calculate the result
      before compiling the code..
      Just type "constexpr" and then hover your mouse into the return variable
      And the compiler will show the result/output/value

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

      @@footballCartoon91 there are more cases to it for example a constexpr constructor and destructor, i still dont fully understand the keyword i think it would be great to have a short video on it in the series

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

    What if someone does not want to write in c# is it also possible to do same with a c++ class here?

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

    Nice job!

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

    I coded this up in JavaScript, and to get the shading on the magenta sphere correct I had to do 1-light… can’t work out why it is different

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

      ok, I've worked out what the problem was. When we are shown the correct shading on the green billboards, we are viewing the scene through *Hazel's* camera and that is pointing in the opposite direction to the *ray tracing* camera.

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

    If I’m not mistaken at the end you’ll have to convert all your math to triangle intersection since that’s what GPU hardware is meant to do, correct me if I’m wrong

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

      GPUs are actually good at doing just about any array math. The real reason to use triangles is because you need some way to define a surface and while things like spheres, cubes, toruses, etc can have their surfaces defined using a simple equation, you want to be able to render arbitrary shapes like characters or buildings and you can approximate arbitrary surfaces by breaking them down into a bunch of triangles.

  • @DevJG2
    @DevJG2 2 года назад +2

    Why does changing the width/height variable affect the density of rays? I would've expected it to just change the width/height of the final image.

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

      Width and height signifies the number of rays being cast horizontally and vertically into the scene. The scene size isn’t being changed.

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

      @@bishboria Yes but that doesn't explain why

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

      @@DevJG2 because even if those are the names he's using, he's just using them to move in a grid some known units

  • @mr.mirror1213
    @mr.mirror1213 2 года назад +2

    very good 👌👌

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

    Did you try jai?

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

    As ever, thank you 👍👍

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

    ray intersections could be a whole series on it's own...lmao

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

    My gpu drivers doesn't support vulkan, is there any way around please ?

  • @JackeryPumpkin
    @JackeryPumpkin 2 года назад +2

    Hazel should have it’s own library of math functions. You should call it HazMat

  • @666nevermore
    @666nevermore 9 месяцев назад

    Man c# is so much more readable. How do I get my eyes used to that c++ syntax ::>>

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

    what is the most enjoyable sphere game, a flipper, or a just a sphere rolling game, world full of spheres and planes

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

      binocular vr double eyed view

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

      particle gas simulation

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

      think about light rays bending around corners, the particle photon (vector model) is not entirely accurate, think 1 and 2 slot photon wave dispersion experiments

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

      its more like a distribution of rays, not just one ray on exact course, statistics vs exact rays

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

      if you have a bright light (hdr) when coming out of a tunnel, the light intensity will be even stronger on the tunnel rim because of the light bending

  • @brainloading5543
    @brainloading5543 2 года назад +2

    "To normaliZe or not to normaliSe"
    Cherno, 27min40

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

    I like how you start series after series and then abandon them all.

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

      Why are you so negative

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

      @@samochreno I don't think I'm negative, are objective. I followed the other series, they were very interesting but they stopped mid course. Most people idolize you, I think there must be a place for a post like mine, don't you ?

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

      @@iseedumbpeople6369 im not cherno bro xD i just have a similiar name

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

      My bad, having fever at the time didn't help. Sorry.

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

    just wow.

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

    Am I the only one to hear a big boom, very low pitched, every so often?

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

    It’s almost painful seeing how slow these episodes come out, I hope your recent post shows you are still working on this

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

    I'm trying to put the brain goo back into my ears

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

    Woah

  • @LOLLOL-gg8jc
    @LOLLOL-gg8jc 2 года назад +2

    Handmade raytracing

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

    ;)

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

    "C"??
    Go away.