Live Coding:Bending Light

preview_player
Показать описание
In this video we'll look at refraction: the bending of light as it moves from one medium to another.

========== Social Media Links ==========

Twitter: @The_ArtOfCode

========== If you want to follow along ==========

Starting point:

End point of this video:

========== Other videos to watch ==========

Рекомендации по теме
Комментарии
Автор

This whole video my cat was fixated with on your head and insisted on attacking you. Another great video, thanks!

sirflimflam
Автор

Thank you god of shaders for blessing us with another video!

sSoKoSs
Автор

Thank you so much i was looking ALL over the place for something like this

masakari
Автор

I will be using your video as apart of my final for uni this semester in my Critical Code class. Thank you for making these complex ideas easy to understand for someone like me!

nicolevella
Автор

I love your tutorials! Very well explained, and topics that I have a hard time finding other places on YT.

Sadjina
Автор

Really cool stuff! And a lot more pitfalls than expected, nice to get good explanations and solutions to the different issues when making this work! :)

tobberh
Автор

Your videos never disappoints. Thank you for making them.

somekindofdevil
Автор

I love your videos, these are my biggest motivations in computer graphics! Thanks for the good work!

xyzxyz
Автор

I'm back here again ;) ... and though I'm sure I've said (written) it before (and will again) I have to express my gratitude and admiration You for Your excellent videos, and for all the work You do to share Your knowledge with us.
It is in my opinion people like You that make Youtube great !
Kind thoughts and best regards.

onlyeyeno
Автор

your skills are impressive. Thanks for the tutorial.

prietjepruck
Автор

This is great and perfect timing in finding this, as I just been charmed by seeing lots of applications of real time refraction in Unreal (like the hardware raytracing prism ones) and others and researching various methods of approaching this, including larger mediums like bodies of water or an atmosphere.
Thanks! Looking forward to the continuation of this.

PeppoMusic
Автор

Map caps lock to escape gang here. Great stuff. Thanks!

snsa_kscc
Автор

Great job as usual, I just like the way you are now moving to the physics and optics side, which is perfect, hope that we will reach to the hard-core PBR soon :) Thanks Martijn ✋

anmaral-sharif
Автор

Amazing.
Thank you from brazil for the great tutorial

ViniciusSouza-mtmm
Автор

Very nice video, the rendering is very good :-)

One thing : the refraction angle equation is n1*sin(theta1) = n2*sin(thêta2) with n1 and n2 the indices of refraction of both touching medium so if the angle of incidence is thêta1, the angle of refraction is sin-1(n1/n2*sin(theta1))

The n1/n2 factor is because it goes from medium 1 to 2, and it is the inverse if you go from medium 2 to 1

It is not a matter of who's denser, you just have to use both indices and divide according to the direction

IAintGotNoBody
Автор

Great tutorial as usual! Just a nit in the total internal reflection diagram, the solid is a denser medium so the angle of the incident ray on the air side should be larger than the refraction angle. :P

paracetamol-m
Автор

I’m curious why you use the normal vector to adjust the position of the point before the second round of raymarching rather than the reflection/refraction vector? Is it just to avoid issues when the angle is very shallow?

SushilaShenoy
Автор

Very cool stuff! But that internal reflection still needs to get refracted out eventually (perhaps after a few more reflections inside the object). As it is now, the internal reflection just goes straight to the cube map (which is obviously not correct).

jay_
Автор

Two quick questions:

1. Would we also want to check for a (0, 0, 0) result from the first refract(...) call as well and handle that scenario or can the first refract never return (0, 0, 0) ?

2. Does the shader language have some form of vec3::ZERO definition that we could use for determining if refract returned (0, 0, 0) instead of the dot(...) calculation? It seems like 3 comparison operations of (x, y, z) might be faster than even a dot calculation?

Cardinal
Автор

Really great video and explanations as always ! I’m wondering how you got the rgb shift working in the example at the start of the video? I would love to see a tutorial about this beautiful shape and the more accurate refractions !

causality