Ray Marching, and making 3D Worlds with Math

preview_player
Показать описание
Built this entire video on raymarching in shaders using shaders, ray marching, and signed distance functions.

Disclaimer: Commission is earned from qualifying purchases on Amazon links.

Follow me on:

In this video, I cover ray marching and some of the cool stuff you can do with it in shaders. We cover basic scene construction, unions/intersections/subtractions, doing smooth minimums, normal generation and soft shadows, and anything else that seems kinda neat about the technique.

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

Patrons can now vote for the next video! Thank you for your support.

simondev
Автор

For the first time I understood what this magic "ray marching" is and how it works. You are good at explaining things

stickguy
Автор

I‘ve actually been working on a graphics engine using signed distance fields as primitives instead of triangles for ~2 years now - super hyped to see it become more and more mainstream recently :D

Chribit
Автор

I've seen a lot of videos about raymarching before, but this is the first time I've "gotten it". The graphics you used to explain it make so much sense.

cucumberedpickle
Автор

Great video, but small correction on a common misconception: Ray marching is just doing raytracing but numerically (so instead of having an equation tell you how far you need to go, you just go in small steps and check if you are inside a shape at any point), it doesn't necessarily involve SDFs (e.g. screenspace reflections also use raymarching, but not SDFs). The special name for this is sphere tracing.

BalintCsala
Автор

I remember this blend mechanic being used in a Valve tech demo from around 2003 where they made blobs able to combine and melt together like here.
Later used years later for Portal 2. Insane they came up with this already back then.

magnusm
Автор

Nice video! I love playing with SDFs too.
One point I think is worth mentioning, which I'm sure you understand but perhaps some viewers won't. It's a misconception that using modulo to repeat the space, and get seemingly infinite copies of your SDF, is for free. From a performance point of view its far from free. It's because then more rays are getting slowed down, and more frequently so, by passing near to surfaces. It is a neat trick though, and if your SDF is fast anyway then its not an issue.

Matkins
Автор

Amazing video, well done on the explanations! The 3D scene really helps to understand, maybe explaining a bit more the code part would be even better

RobinPayot
Автор

I have started the glsl course a couple weeks back and am learning so much! Thank you!!

gtnbssn
Автор

for smoothmin(a, b, k), using smoothmax(a, b, -k) also works and is possibly slightly easier to write in code.

lordlightspeed
Автор

I was really envisioning this for an attack in my 3d plaforming game as an obstacle. Thx

ArtisanAspirationWorks
Автор

It's great to see more content like this. Loved your explanation of the central differences method.

guaje
Автор

This is quite cool, ive added these in Unreal engine and u can even blend with the mesh generated SDF

Madlion
Автор

Now THIS is how you sell a course.
Great content!

Shamysoza
Автор

Wonderful Simon, came here from another one of your shader vids, mind-blown that you made the actual video using ray-marching, now picking jaw up from table

uquantum
Автор

Spore-like games would benefit heavily with ray marching, its always something ive thought about. you could build a cell and have the individual cell parts combine using ray marching or make cellular animations of two spheres dividing or even have creature parts be put together using ray marching. Ray marching gives endless opportunities

UrodCyka
Автор

this was the single coolest video I've seen on YouTube for a while

aquanton
Автор

I just coded my first ray marcher and I found it way easier than a raytracer, plus you can do a lot more amazing stuff.

somerandomidk
Автор

I like the explanation! I'm working on my own ray marching based graphics engine right now and, while your demo here is far more polished, I'm getting places.

awesomecronk
Автор

CodeParade's marble marcher uses ray marching, if you haven't heard of it, it's really cool, you roll a marble along a fractal which is sometimes morphing around in real time

Rennu_the_linux_guy