How does ray tracing produce hyper realistic graphics? | Bitwise

Ойындар

I'm a professional programmer who works on games, web and VR/AR applications. With my videos I like to share the wonderful world of programming with everyone!
What's the next step beyond rasterization? How does ray- and pathtracing create these hyper realistic graphics? We'll look into the inner workings of ray tracing as well as some of the challenges associated with it.
Timestamps
0:00 Intro
2:09 Problems with rasterization
5:50 How light travels
8:10 BVH
10:15 Lighting primitives
12:20 Light bouncing, reflections and refractions
14:25 Other applications of ray tracing
15:46 Problems with ray tracing
17:35 Conclusion
My patreon: / digidigger
References:
How does rasterization work? • How do games render th...
No! Euclid! GPY Ray tracer • "No! Euclid!" GPU Ray ...
Minecraft RTX demo • Video
Interactive sound propagation with bidirectional path tracing dl.acm.org/doi/10.1145/298017...
Music in in outro:
Besus y Abrazor - Rolemusic: freemusicarchive.org/music/Ro... available under a Creative Commons Attribution license creativecommons.org/licenses/...

Пікірлер: 85

  • @RakastanPorkkanakakkua
    @RakastanPorkkanakakkua2 жыл бұрын

    Honestly, learning that ray tracing can simulate sound waves was what really struck a chord in me.

  • @REALsandwitchlotter

    @REALsandwitchlotter

    2 жыл бұрын

    BOOM…BOOM!! (Excuse the “basil brush the seventies fox puppet” reference:)

  • @StigDesign

    @StigDesign

    Жыл бұрын

    Yes you can think of it like that too, and its more easy to try in real life, Play music in one room and you go to another room and listen, close the door and hear difference :D

  • @SplitScreamOFFICIAL
    @SplitScreamOFFICIAL2 жыл бұрын

    "He's Back!" -I'm sponsored by Raid Shadow Leg- "but at what cost"

  • @bigpencil6032

    @bigpencil6032

    2 жыл бұрын

    He's back + he gets more money, there is no negative points

  • @cavemann_

    @cavemann_

    2 жыл бұрын

    @@bigpencil6032 Promoting a mobile gambling game is definitely a negative point. Ok it's not true gambling, but it's scummy asf

  • @bigpencil6032

    @bigpencil6032

    2 жыл бұрын

    @@cavemann_ I personally don't care about the promotions in the videos I just skip them especially when it's raid shadow legends

  • @Ashona
    @Ashona2 жыл бұрын

    Will I ever use this information? Probably not. Will I still watch the entire video because Digi made it? Yeah

  • @zyansheep
    @zyansheep2 жыл бұрын

    He finally remembered his youtube password...

  • @Thebreak1

    @Thebreak1

    2 жыл бұрын

    Raid shadow legends is finall happy a year later xD

  • @Cypeq
    @Cypeq2 жыл бұрын

    Funny enough we've had raytraced audio over a decade ago, with creative EAX 3 and it sounded so much better... games that fully supported it were quite spectacular sounding, audio source positioning was very accurate, unlike nowadays. It's weird that hardware audio acceleration died like it did.

  • @ThylineTheGay

    @ThylineTheGay

    2 жыл бұрын

    yeahh, it's dissapointing that things like that and physics arent as popular

  • @carl8790

    @carl8790

    2 жыл бұрын

    I think it has to do with people not liking the idea in buying another hardware to just do one specify task, when there are many inexpensive solutions. Like, it makes sense if your job requires it, but for the average gamer, it's not. This is why Nvidia integrated their Raytracing accelerated hardware with their GPU. If they had sold it separately, it would have been a very difficult sell to gamers.

  • @zxuiji
    @zxuiji2 жыл бұрын

    Now this was a truly useful episode for me, however there IS way to let the ray go "infinitely", if you record the limits of the scene boundaries - so for example if the furthest x point is 100.0 & -100.0 respectively - and split the scene into boxes (where you can then use the old 2d ray trace method of roughly "if ( rx >= ry ) rx += inc; else ry += inc;") you can then cut off any ray the moment it's rx value goes outside those scene boundaries for the x-axis because at that point you know for sure nothing can be seen beyond that point, this can be further sped up but splitting each scene into sub scenes that are not absolutely positioned but placed at an offset from 0.0 based on how far from the focused sub scene it the sub scene is (e.g. frontScene->z = activeScene->layer - frontSceneA->layer), this gives you a fixed distance based on how many front sub scenes are drawn in the first place, the over arching scene will always be drawn at low poly and unobstructed light state, this will never be noticed because the sub scenes in front of the active scene will hide any low poly stuff. I'm in the middle of learning OpenGL atm so when I've progressed enough to start drawing full on scenes and not just few triangles with a texture here and there I will programme an actual example of what I mean.

  • @zxuiji

    @zxuiji

    2 жыл бұрын

    @Doctor Zoidenberg I already have rough math for it, I just need to finish building an environment to refine it in since trying to do so with a pen & paper ain't happening

  • @4P5MC

    @4P5MC

    2 жыл бұрын

    I'm a bit late to the discussion, but what would happen in the case of two perfectly reflective surfaces facing each other? Would the ray infinitely bounce since there's no end condition?

  • @zxuiji

    @zxuiji

    2 жыл бұрын

    @@4P5MC no, that's what the scene boundaries are for, if the ray get's longer than the difference between it's emition/bounce point and the scene boundaries then you simply stop the loop as it's impossible for it to hit any stored objects at that point

  • @4P5MC

    @4P5MC

    2 жыл бұрын

    @@zxuiji Ooh, I get it now!

  • @zxuiji

    @zxuiji

    2 жыл бұрын

    @@4P5MC I should point out that using the difference between the emition/bounce point is actually the slower method of cutting off the ray loop, the faster method is to first put it's angle in normalisation territory relative to the scene and then work out which corner it's facing, after that you simply take part of the scene's total height & width (so offset everying so there are no negatives including the start point of the ray), minus the ray starting point from the part you took, multiply the normalised angle x/y values against those parts and you'll have the max distance the ray can travel in any dimension, much faster than square root, albeit more complicated

  • @Corruptgore
    @Corruptgore2 жыл бұрын

    really love these types of developer commentaries, explaining and figuring out how things work, amazing work

  • @wills_turtles
    @wills_turtles2 жыл бұрын

    Good video, but misses a bit of the explanation. See the premier comments about people misunderstanding about how many rays are emitted from rough surfaces.

  • @Tomyb15
    @Tomyb152 жыл бұрын

    Raytracing for sound (or just some for of holophonic sound) is something I've always been asking for in games. While graphics have kept improving at an incredible rate, sound has mostly remained the same for many years. The most I get out of stereo sound with headphones is to be able to tell that something is to my right or left and gauge the distance from the volume. It really breaks all immersion for me. And it's not like you need one ray for each pixel when it comes to sound, because there are no pixels! There is something to that end from dolby, but it completely proprietary and expensive and almost no games use it. What I want is good 3d sound to be standard and expected in 3d games, not an expensive gimmick.

  • @davidmurphy563

    @davidmurphy563

    2 жыл бұрын

    You can technically use ray casting (not ray tracing, that's impossible, fragment shaders operate on a wavefront and don't return data, that's what makes them so quick) for a super basic implementation but bouncing ray casts off collision meshes looking for the sound origin is prohibitively expensive for very little gain. The usual hack is to use the path finding your NPCs are using. That way you stop noise coming through walls but let it go through doors. Calculating stereo from that is easy enough. Whether you'll ship a single extra unit from going to the effort is another question and this all costs dev time and fps.

  • @kapilbusawah7169

    @kapilbusawah7169

    2 жыл бұрын

    The PS5 has a dedicated sound module for exactly sound engineers in game. The work that little processor does for example would require the entire power of the PS4 to "render"

  • @gabrielandy9272

    @gabrielandy9272

    2 жыл бұрын

    not all games keep technology of sound the same, Source engine (valve games) distort sounds based on the materials it travel trough..... it don't simulate then with ray tracing its acctualy just a straight line from source sound to player, but any material it hits in the path the sound get applied a distortion effect based if its wood metal etc.... cs go is already using this.. VALVE is as company that have amazing sound in games anyway.... some of its games even used dynamic generated music very early. play any valve game with a good headphone and you will notice that its quality is way above many other games...

  • @straydrop411
    @straydrop4112 жыл бұрын

    Best ray tracing explanation video ever. I have watched this from Japan🌸 but nothing more concrete order and more proper choice of words plus pictures like this. I hope more people would watch this then can easily comprehend the latest graphics technology. 😃 ( cheering for you🥇

  • @eboatwright_
    @eboatwright_2 жыл бұрын

    I love this channel :) Thanks for making great videos!

  • @yuriterra1
    @yuriterra12 жыл бұрын

    Really good video :D I love watching your channel

  • @Neph0
    @Neph02 жыл бұрын

    Love the fact that you chose footage of sheep herding while promoting Raid

  • @miscu2542
    @miscu25422 жыл бұрын

    Awesome video as your previous ones!! Thanks a lot for spreading all this knowledge in a so clear way!

  • @nitro99x
    @nitro99x2 жыл бұрын

    Always great to see a new video. I personally don't really who you're sponsored by, as long as it doesn't effect the videos content. 👍🏼

  • @kepler1175
    @kepler11752 жыл бұрын

    Havent seen.. er, heard it applied with sound before to my knowledge. Really cool

  • @ReBufff
    @ReBufff2 жыл бұрын

    Very informative and entertaining, hopes to more videos soon!

  • @stredo6683
    @stredo66832 жыл бұрын

    i love your videos, keep it up o/

  • @quentinmcwimberton6797
    @quentinmcwimberton67972 жыл бұрын

    Sponsored by Ray: Tracing Legends

  • @XD-zg6ii
    @XD-zg6ii2 жыл бұрын

    I see what you “numbered” in BVH but anyway thank you for this knowledge

  • @justinbuergi9867
    @justinbuergi98672 жыл бұрын

    Well this is convenient I’m learning about Ray tracing in class this week

  • @REALsandwitchlotter
    @REALsandwitchlotter2 жыл бұрын

    This is good thanks

  • @necronull3767
    @necronull37672 жыл бұрын

    I love your content man, always a pleasure to see you upload

  • @Lukegear
    @Lukegear2 жыл бұрын

    Nice!

  • @Komplexitet
    @Komplexitet2 жыл бұрын

    The youtube compression system did not like this video xD especially around 14:00 haha. Love the vid!

  • @bernardonegri5416

    @bernardonegri5416

    2 жыл бұрын

    It is a flaw of the ray tracing algorithm they decided to use in this scene. He said the scene becomes grainy if you move around because it takes a while for the averages to cancel each other out.

  • @vokonmusic
    @vokonmusic2 жыл бұрын

    I love this channel :)

  • @anbu5667
    @anbu56672 жыл бұрын

    your channel is insane

  • @freezinfire
    @freezinfire2 жыл бұрын

    Finally you've made this, I waited so long

  • @drinkwatrr9883
    @drinkwatrr98832 жыл бұрын

    We missed you Digi

  • @matrix9452
    @matrix94522 жыл бұрын

    Nice

  • @fazeelicopter8988
    @fazeelicopter89882 жыл бұрын

    The return of the king

  • @Hyphen3372
    @Hyphen33722 жыл бұрын

    ayy new upload.

  • @D.S69
    @D.S69 Жыл бұрын

    I think that as long as something is fun that's all that matters

  • @ZimmervisionCZ
    @ZimmervisionCZ2 жыл бұрын

    Wait, do you know where that tech demo for the audio ray tracing comes from? To my eye, that looked a LOT like an upper floor of Angell Hall at the University of Michigan

  • @madness_lab
    @madness_lab2 жыл бұрын

    2 videos in a year? youre on fire dude 😎😎👌👌

  • @nikaknigde5104
    @nikaknigde51042 жыл бұрын

    Feels a lackage of Vsause music in the background :D

  • @cylexx
    @cylexx2 жыл бұрын

    the king is back

  • @stig6339
    @stig6339 Жыл бұрын

    According to the thumbnail ray tracing is so powerful it can change clothing on Herald

  • @biaxthepanda
    @biaxthepanda2 жыл бұрын

    I just came across to this channel after wondering how portals in the game portal works. As a gamedev i would definetly would like to see more of the "How ..." videos. Geep up the good work!!

  • @Theraot
    @Theraot2 жыл бұрын

    11:50 #RealisticPerfectMirrorReflectionAngle

  • @guts2048
    @guts20482 жыл бұрын

    Why does the description of raid always look the same do they just copy and paste it?

  • @NICK....

    @NICK....

    2 жыл бұрын

    Because it essentially is, mobile ads have ridiculously strict ad reads

  • @guts2048

    @guts2048

    2 жыл бұрын

    @@NICK.... bruh

  • @jumbledfox2098
    @jumbledfox20982 жыл бұрын

    Next video: How to put out a burning GPU | Bitwise

  • @Zweemanuel
    @Zweemanuel2 жыл бұрын

    9:08 Nice

  • @SimonLedoux
    @SimonLedoux2 жыл бұрын

    I love cats

  • @realdonutking123
    @realdonutking123 Жыл бұрын

    15:02 oh my GOD i thought someone was in my house

  • @joltedjon
    @joltedjon2 жыл бұрын

    9:07 lmao the areas

  • @fatfingersman
    @fatfingersman2 жыл бұрын

    ok, but now tell me how magnets work..

  • @freezinfire

    @freezinfire

    2 жыл бұрын

    do you know quantum spin? Magnets are basically just conducting metals having their electrons with same spin stuck at one side of the atom making static electricity making magnetic fields. that's basically the gist of it. in other words, oonga boonga magic

  • @BloodAssassin
    @BloodAssassin2 жыл бұрын

    Next video in a couple of months?

  • @mranxiety9995
    @mranxiety99952 жыл бұрын

    Always love a new video. Ive missed ur accent

  • @Helloyunho
    @Helloyunho2 жыл бұрын

    he’s back: panik it’s about ray tracing: panik sponsored by raid shadow legend: *PANIK*

  • @BloxXor
    @BloxXor2 жыл бұрын

    tell me about terraria

  • @Phytom
    @Phytom Жыл бұрын

    Ray tracing is when you loose 50 FPS for smoother shadow edges.

  • @CirqueAlvis
    @CirqueAlvis Жыл бұрын

    9:10 hehe 420 69

  • @konkelberryfinn
    @konkelberryfinn Жыл бұрын

    A: 420 and A: 69

  • @-o-1695
    @-o-16952 жыл бұрын

    Mf at google is still holding out on quantum computer techs. Imagine the good things we could have

  • @handledav
    @handledav6 ай бұрын

    so

  • @sehaless
    @sehaless2 жыл бұрын

    Great content, but that sponsor... >.

  • @fxarachnid4764
    @fxarachnid4764 Жыл бұрын

    What if there was raytracing with quantum physics taken into account? Actually, no, please don't make that (but maybe do though).

  • @QiotiCoyote
    @QiotiCoyote2 жыл бұрын

    you GOTTA either mute video game footage you show while you're talking, or have minimal sound effects like walking only, on low volume otherwise it's so hard to pay attention or even hear what you're saying it's fine having a video, it's even nice to be able to watch something while you're talking and having just footsteps barely hear able kind of fades into the background and doesn't take away from your voice but anything that's outside a rhythm, like combat or voices, dialogue, or music, or even anything where there main focus is to read as in non voiced dialogue can all take focus away from what you're saying

  • @gigigigiotto1673
    @gigigigiotto16732 жыл бұрын

    i don't think your definition of roughness is correct

  • @davidmurphy563
    @davidmurphy5632 жыл бұрын

    I mean, you discussed ray tracing without using the word "vector"... Ok. No matrices being multiplied either. No basis and origin clearly. No dot or cross products. No normalisation. No UV. No fragment shader. No vertices with no indexes and no normals. I dunno. It's kinda like promising to explain how a grandfather clock works and having no mention of cogs. No hands, no pendulum, no springs, you get the idea... All you really described were a few optimisation tricks. Maybe change the title to "some optimisation tricks used in ray tracing".

  • @quentinmcwimberton6797

    @quentinmcwimberton6797

    2 жыл бұрын

    Isn't the point of these videos to go in-depth into programming concepts and what they are, but in Laymen's terms? Vectors, matrixes and the likes are all easily googleable if you wanna calculate shit with them yourself, this video more shows what ray tracing is and what it does.

  • @davidmurphy563

    @davidmurphy563

    2 жыл бұрын

    @@quentinmcwimberton6797 Teaching how to do the calculations is obviously impractical. Khan Academy has over a 140 videos laying the groundwork. But this vid is bizarre, it goes from the most basic explanation possible (a ray is bounced from the camera to the light source) to some pretty irrelevant trivia regarding optimisation that has next to nothing to do with the fundamentals and are just work arounds to hardware bottlenecks. Say you were explaining how an ICE works, your explanation is "you put fuel in, spark goes boom which turns a crack pushing car forward" and then going on to explain why an overhead cam is used instead of pushrods. This is equally weird. The explanation is trivial to the extent of being what you would give to your drunk uncle in the pub followed by some weird detail. But really, I'm not saying the vid is terrible, only that the title should have been different.

  • @andrewwagner942
    @andrewwagner94211 ай бұрын

    Stop making dirt shiny

  • @a_grin_without_a_cat
    @a_grin_without_a_cat2 жыл бұрын

    Sound mastering at the end is fuuuuuucking horrible, I guess I can bet that I haven't heard worse shit like this ever :)

Келесі