• entries
32
68
• views
31120

# Shadow Mapping Part 1 PCF and VSMs

3617 views

In this post I'm going to discuss basics of shadow mapping and two popular methods of filtering shadow maps PCF (Percentage Closer Filtering) and VSM (Variance Shadow Maps). (All of the used shadow maps are 4096*4096)

# Aliasing Problem

## Figure 2-1 The Aliasing Problem On The Edges

Figure 2-2 Handling Aliasing Problem Using VSM

Figure 2-3 Handling Aliasing Problem Using PCF

# PCF (Percentage Closer Filtering)

## P(x>t),

but only an upper bound, this upper bound still is a good approximation for

.

# VSM's Light Bleeding Problem And Solutions

## The sampling offsets (sent to shader using a UBO):

float invsqrt2 = 1.0f/sqrt(2.0f);//the sample are in the same distance form the centerfloat invSMres = 1.0f / float(Shadowmap_Res)*2.0f;// the second level mipmap's texel sizefloat text_offsets[16] = { invSMres, 0.0f, -invSMres, 0.0f, 0.0f, invSMres, 0.0f, -invSMres,invSMres*invsqrt2, invSMres*invsqrt2, -invSMres*invsqrt2, -invSMres*invsqrt2, invSMres*invsqrt2, -invSMres*invsqrt2, -invSMres*invsqrt2, invSMres*invsqrt2};

Thank you for reading. I'll be glad to improve any part that has a problem so feel free to ask about your problems and pointing out problems in my post .

My next post will discuss the Paraboloid Mapping propaganda.

hehe.

good job !

looking forward to the Part 2 !

Looks very interesting, will read in more detail later. Thanks for posting.

No images.

sorry the attachment system is not working, i'll fix it soon