What is Ray Marching?

preview_player
Показать описание
In this shader tutorial, we will go over the basics of Ray Marching with Signed Distance Fields. We start by understanding the theory behind the algorithm. Then we implement a simple ray marcher in GLSL. After that, we calculate the normals and add lighting to the scene. Then we run the ray march algorithm again to calculate shadows. Finally, we learn how to blend to SDFs using the smooth union operation.

== [ Resources ] ==

== [ Timestamps ] ==
00:00 Intro to Ray Marching
00:59 Ray Marching Algorithm
03:15 Coding a Ray Marcher
06:18 Add Lighting with Normals
07:47 Ray March Shadows
09:14 Blend with Smooth Union

== [ Tags ] ==
#suboptimal #glsl #shaders
Рекомендации по теме
Комментарии
Автор

Awesome! It's awesome to see graphics content being explained so clearly. Wish you all the best.

saltukkezer
Автор

It's a very helpful video. Thank you.

sergeys
Автор

Thank you so much for this! I'm trying to make a shader to simulate liquid, making small circles in a particle system seem to belong to a bigger drop of liquid when they are close to each other. I don't know if I'm making myself clear, but I think this video is putting me in the right direction, thanks!

pedrohov
Автор

That looks really nice and I love that it feels like there's a lot of cool things you can do with the algorithm; Blending the shapes like that is a nice looking technique too - some lovely organic surfaces possible! I'm interested to combine this technique with a varient of shell texturing ... no specific reason, I just want to play with it and see what happens - with any luck I can turn my central heating off and let my 3070 warm up the room 😀

suvetar
Автор

Excellent tutorial!!

Just one thing, I'm having an issue where if I move the sphere along the x axis, the lighting gets all messed up (if i offset the sphere to the left, the normals also point slightly towards the left, skewing the lighting in the wrong direction). If you encountered this issue as well, how did you resolve it?

anirbandeshmukh
Автор

"vec3 lightDirection = normalize(lightSource);" confused me. I think it should be "vec3 lightDirection = normalize(lightSource - p);", although both i tried did the same work

hortonmark
Автор

Can ray marching replace shadow mapping?

clifflin
Автор

I see a lot of these ray marching videos
but I still don't understand why you would even want this?
Like what are some real practical applications, does it make games faster?

ralkey