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

  Рет қаралды 53,071

The Cherno

The Cherno

Күн бұрын

Пікірлер: 77
@TheCherno
@TheCherno 2 жыл бұрын
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 жыл бұрын
I physically feel my brain cell number increasing with this series
@MichaelKingsfordGray
@MichaelKingsfordGray 2 жыл бұрын
You can't even recall your real name!
@QuintinMassey
@QuintinMassey 2 жыл бұрын
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 жыл бұрын
This raycasting series is the best visualization I've seen online. Thank you for the videos, they've been very useful.
@redafakih12
@redafakih12 2 жыл бұрын
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🔥
@gwch3481
@gwch3481 2 жыл бұрын
24:20 The math was so deep, the camera had a hard time staying focused :)
@TheRealMangoDev
@TheRealMangoDev 6 ай бұрын
lol
@oguzhantopaloglu9442
@oguzhantopaloglu9442 2 жыл бұрын
I love how you used Hazel to visualize it!
@maxmustermann8250
@maxmustermann8250 2 жыл бұрын
Cherno back at it again with the fresh fade 😎
@xmk89
@xmk89 2 жыл бұрын
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?
@ViniciusMiguel1988
@ViniciusMiguel1988 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.
@andmefikri7555
@andmefikri7555 2 жыл бұрын
I post this comment to increase the engagement of this video for KZbin. This series have been amazing so far.
@spectrm6014
@spectrm6014 2 жыл бұрын
You have the best explanations, thank you for these videos, oh and btw, nice hair :)
@suri4Musiq
@suri4Musiq 2 жыл бұрын
Amazing visualization! Love your work Cherno
@aaronh248
@aaronh248 2 жыл бұрын
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
@alfredonoodle
@alfredonoodle 2 жыл бұрын
Love using hazel as a visualization tool. More like this, please 🙏!
@bishboria
@bishboria 2 жыл бұрын
Starting to get quite spicy!
@maqabayker
@maqabayker 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.
@kumu2024
@kumu2024 11 ай бұрын
Just watching this videos, will not be enough to digest the information :)
@CP-sr6ml
@CP-sr6ml Жыл бұрын
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
@Pevi70
@Pevi70 2 жыл бұрын
Loved it, thanks!
@kinkazax
@kinkazax Жыл бұрын
You are very good teacher
@Theodorlei1
@Theodorlei1 2 жыл бұрын
So well explained with the code and live visuals side by side
@yapayanzeka
@yapayanzeka Жыл бұрын
unbelievable tutorial I've ever seen
@quanta8382
@quanta8382 2 жыл бұрын
Wow hazel seems amazing! I can only hope to become as good as you!
@chennebicken372
@chennebicken372 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
@glenneric1
@glenneric1 2 жыл бұрын
Nice job!
@akbarisroilov1002
@akbarisroilov1002 Жыл бұрын
why Hazel uses C# instead of C++ ?
@mr.mirror1213
@mr.mirror1213 2 жыл бұрын
very good 👌👌
@nacnud_
@nacnud_ 2 жыл бұрын
As ever, thank you 👍👍
@tljstewart
@tljstewart 2 жыл бұрын
this is interesting, i’m curious how you determine the hit position of a more complex shape that’s not mathematically defined?
@nowherebrain
@nowherebrain 2 жыл бұрын
ray intersections could be a whole series on it's own...lmao
@samochreno
@samochreno 2 жыл бұрын
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 жыл бұрын
@@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
@brainloading5543
@brainloading5543 2 жыл бұрын
"To normaliZe or not to normaliSe" Cherno, 27min40
@DevJG2
@DevJG2 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
@bishboria
@bishboria 2 жыл бұрын
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.
@JackeryPumpkin
@JackeryPumpkin 2 жыл бұрын
Hazel should have it’s own library of math functions. You should call it HazMat
@SXpitbull
@SXpitbull 2 жыл бұрын
My gpu drivers doesn't support vulkan, is there any way around please ?
@tabletopjam4894
@tabletopjam4894 2 жыл бұрын
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.
@bijinregipanicker6916
@bijinregipanicker6916 2 жыл бұрын
Did you try jai?
@iseedumbpeople6369
@iseedumbpeople6369 2 жыл бұрын
I like how you start series after series and then abandon them all.
@samochreno
@samochreno 2 жыл бұрын
Why are you so negative
@iseedumbpeople6369
@iseedumbpeople6369 2 жыл бұрын
@@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 жыл бұрын
My bad, having fever at the time didn't help. Sorry.
@Jkauppa
@Jkauppa 2 жыл бұрын
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
@666nevermore
@666nevermore 11 ай бұрын
Man c# is so much more readable. How do I get my eyes used to that c++ syntax ::>>
@nicobugs
@nicobugs 2 жыл бұрын
Am I the only one to hear a big boom, very low pitched, every so often?
@BitWise501
@BitWise501 2 жыл бұрын
just wow.
@tabletopjam4894
@tabletopjam4894 2 жыл бұрын
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
@LOLLOL-gg8jc
@LOLLOL-gg8jc 2 жыл бұрын
Handmade raytracing
@samvodopianov9399
@samvodopianov9399 2 жыл бұрын
Woah
@oamioxmocliox8082
@oamioxmocliox8082 2 жыл бұрын
;)
@MichaelKingsfordGray
@MichaelKingsfordGray 2 жыл бұрын
"C"?? Go away.
LIGHTING AND SHADING // Ray Tracing series
32:38
The Cherno
Рет қаралды 47 М.
FASTER Ray Tracing with Multithreading // Ray Tracing series
22:23
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
How Ray Tracing (Modern CGI) Works And How To Do It 600x Faster
32:06
Josh's Channel
Рет қаралды 583 М.
Recursive Ray Tracing - Computerphile
17:38
Computerphile
Рет қаралды 43 М.
Adding an Interactive 3D Camera System // Ray Tracing series
27:43
Finding and Fixing Slow Code // Ray Tracing series
29:02
The Cherno
Рет қаралды 47 М.
Coding Adventure: Ray Tracing
37:58
Sebastian Lague
Рет қаралды 1,2 МЛН
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 1,2 МЛН
Super Fast Ray Casting in Tiled Worlds using DDA
30:03
javidx9
Рет қаралды 190 М.
How Ray Tracing Works - Computerphile
20:23
Computerphile
Рет қаралды 98 М.
Planet atmospheres, ray-sphere intersections.
7:24
Martin Donald
Рет қаралды 28 М.
Writing a game the hard way - from scratch using C. #1
34:20
NCOT Technology
Рет қаралды 195 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН