Hi.

I’m working with the robust stencil shadows volumes, as presented in the 2002 siggraph article, and Eric Lengyel column from gamasutra, but there seems to be some things i have a hard time understanding, with regards to the projection matrix with backclipping plane at infinity.

First of, they do a homogenous vector difference - What is this?

I would say it should be X_1/W_1 - X_2/W_2, but somehow, they rearrange it to be X_1*W_2-X_2*W_1.

I can clearly see that it just works™, and that my arithmethic will fail for lights/points at infinity. What is the explanation, how is it rewritten? How do I intuitively understand it?

The second thing is with regards to the matrix. Given the vector difference, I see no reason why we should not end up with a point projected to infinity, looking like this

[ x y 0 0 ]

in case the light and the vertex have the same z value. This leaves me wondering what will happend in the clip stage.

Clearly the only value that will satisfy

-w <= (x,y,z) <= w, is zero. The z value is fine, but what happends to x and y? Will the clipping clip them to zero?

Can this really be what is happening?

Any hints appreciated, I’m going to refresh those line clipping algorithms to try and understand what happends.