Shadow Mapping Unleashed! // OpenGL Tutorial #38

preview_player
Показать описание
In this video we take a look at five techniques to reduce the effect of several known problems in shadow mapping such as shadow acne, peter panning and more.

Timecodes
0:00 Intro
0:24 Solution #1: Flexible bias
3:26 Solution #2: Reverse face culling
4:43 Solution #3: Slope scale depth bias
6:51 Solution #4: Clamp to border
8:18 Solution #5: Tight light projection frustum

More info on shadow mapping problems can be found in:

If you want to get the same version that was used in the video then checkout the tag TUT_38_SHADOW_MAPPING_UNLEASHED.

Feel free to comment below.

Twitter: @ogldev

Enjoy,

Etay Meiri

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

More than happy to support you on Patreon! This is wonderful content, thank you!

therealjtgill
Автор

I appreciate your effort to make these tutorials, thank you

alvpjh
Автор

Very cool! I have a question though, wouldn't the Reverse face-culling solution fail if i had a non-closed mesh? I.e. a plane mesh acting as a "wall". Let's say i place perpendicular to the ground, if i understand the solution correctly, it should fail to produce shadows since there won't be any back facing triangles

sagielevy
Автор

Very informative. Thanks for article links.

xotmatrix
Автор

I'm using reverse face culling for rendering shadows, but there is tiny gap on the border between the object and its shadow. How to solve this issue? Is PCF a possible solution?

clifflin
Автор

As someone said in another comment, how do you fix the small gap between, for example, the ground and an object on top of it? I've set my bias to zero and there still a tiny but noticeable sliver of "unshadowed" area where an object touches the ground.

pedroocm
Автор

Oh no I have to fix my shadows now, thanks tho!

fez
Автор

Wow total shadow tech video is very good!! I have two question. first flexible bias equation is not consider texSize and not linear so i think it was to be "bias = sin(acos(NDL))*texSize" is it right?? but this equation may be heavy.. :( second your coord and vector plot in blue slide is very efficient to read can i get a name of program for make this?

miumpre
Автор

Do you have a plan to explain the CSM in your tutorial, I can read the blog on your website. I implemented CSM according to LearnOpenGL but I found that the shadow acne is really trick to overcome.

赟杨
Автор

For the tight-fitting light-projection, I feel like I completely understand each component 110%, but putting it all together it's just not anywhere close to working. Does my world space up-axis matter at all? That's the only difference from my code and yours, but I don't think it would make a difference. Also instead of doing tan to find the frustum planes I'm using the inverse projection matrix, maybe that's the issue too.

astphaire
Автор

What's the point of calculating the first AABB without translation in the light space matrix if we are just going to end up reverting it back into world space then back to light space with translation and use the AABB based on that.

edit: oh, we get the center of the first AABB, then calculate the world position of that, and then transform that using light space matrix with translation.

Josh-hljl