A027298

04-03-2004, 10:18 PM

I badly try to understand perspective correct texturing and projective texturing which is used for shadow maps.

Ok, so far as I know...:

on the vertex stage:

calculate s/w, t/w, r/w, q/w (w is viewspace w and strq is the texture coordinate)

...

rasterization

interpolate those values, calculated in the vertex stage, liniarly over the polygon.

..

on the pixel stage:

calculate

s/q = (s/w) / (q/w)

t/q = (t/w) / (q/w)

r/q = (r/w) / (q/w)

Ok, after this division, w is not anymore inside that fraction. So why are then the values in the vertex stage divided by w? I just could interpolate s,t,r,q over the polygon and in the pixel stage I also would get s/q, t/q and r/q.

I know, by implementing shadow maps with Opengl I do not have explicitely to understand that, but I really would like to understand the concept behind it. I read the paper "Fast Shadows and Lighting Effects Using Texture Mapping" from Segal et al. And I also read the shadowmap powerpoint presentation from nvidia. But I still have problems with it.

Therefore, any help on this is greatly appreciated.

Thanks!

Ok, so far as I know...:

on the vertex stage:

calculate s/w, t/w, r/w, q/w (w is viewspace w and strq is the texture coordinate)

...

rasterization

interpolate those values, calculated in the vertex stage, liniarly over the polygon.

..

on the pixel stage:

calculate

s/q = (s/w) / (q/w)

t/q = (t/w) / (q/w)

r/q = (r/w) / (q/w)

Ok, after this division, w is not anymore inside that fraction. So why are then the values in the vertex stage divided by w? I just could interpolate s,t,r,q over the polygon and in the pixel stage I also would get s/q, t/q and r/q.

I know, by implementing shadow maps with Opengl I do not have explicitely to understand that, but I really would like to understand the concept behind it. I read the paper "Fast Shadows and Lighting Effects Using Texture Mapping" from Segal et al. And I also read the shadowmap powerpoint presentation from nvidia. But I still have problems with it.

Therefore, any help on this is greatly appreciated.

Thanks!