CH 14 - Deferred Rendering

Sorry in advance that this question is so open-ended.

I understand most everything going on in the deferred rendering part of the chapter. Everything except the fragment shader code, when you obtain the “current sample,” which is equal to “shadowposition.z / shadowposition.w .”

How on earth is this the current sample?

I thought that the shadow position is essentially the same as the vertex position except that its being multiplied by the shadowmatrix and modelmatrix. Can anyone elaborate on the shadowposition?

I think there might be an error there, but I haven’t been able to look at it yet.

Someone else was also puzzled by this code, and this was my answer: Confusion over [[position]] attribute in fragment shader - #3 by caroline.