mjs1

07-06-2005, 06:14 AM

I was reading the article on subsurface scattering on rendermanacademy.com and had a question about transforming points from one space to another. In the article one of the goals is to transform a point being shaded into the light camera's NDC coordinates in order to create s,t coordinates for a texture lookup into the depth map rendered from that light camera. It says to transform the point P being shaded by the projection matrix of the light source camera, after which the point is translated and scaled in order to get it into NDC space.

What I'm unclear of is how multiplying the point P with the light camera projection matrix alone will help. Wouldn't you first have to multiply P by the light camera viewing matrx and THEN by the light camera projection matrix to get the correct shadow map lookup assuming that P is in "world" space? Or is Renderman smart enough to do this when you tell it you want a world space point in a camera's projection matrix space? When you transform a point in Renderman into another space are you doing a straight matrix multiply or are you doing in some cases a number of matrix multiplications under the hood, with Renderman knowing what space the point is currently in and what matrices it needs to multiply through to get to the space you need?

Thanks!

What I'm unclear of is how multiplying the point P with the light camera projection matrix alone will help. Wouldn't you first have to multiply P by the light camera viewing matrx and THEN by the light camera projection matrix to get the correct shadow map lookup assuming that P is in "world" space? Or is Renderman smart enough to do this when you tell it you want a world space point in a camera's projection matrix space? When you transform a point in Renderman into another space are you doing a straight matrix multiply or are you doing in some cases a number of matrix multiplications under the hood, with Renderman knowing what space the point is currently in and what matrices it needs to multiply through to get to the space you need?

Thanks!