PDA

View Full Version : What is the scale-bias matrix?



Anders
08-27-2002, 06:55 AM
Hi

I am currently reading a paper by Cass Everitt on shadow mapping and I have one question. In the paper, there is an equation for calculating the texture coordinates like so:
[s, t, r, q] = S P L M[xo, yo, zo, wo]

s, t, r, q are the texture coords
xo, yo, zo, wo are the coords given in object space
M is the matrix that transforms from object to world space
L transforms from world to light space
P is the projection matrix for the light source
S is the scale-bias matrix, but what exactly does it do? It is given as

|0.5 0.0 0.0 0.5|
|0.0 0.5 0.0 0.5|
|0.0 0.0 0.5 0.5|
|0.0 0.0 0.0 1.0|

So the question is what is S, the scale-bias matrix? What does it do, and why does it have to be specified as such?

Regards

PH
08-27-2002, 06:58 AM
It scales and biases texture coordinates in [-1,1] such that they are in the [0,1] range.

Anders
08-27-2002, 07:07 AM
O.K. thanks! That is of course necescary to do the depth comparison correctly.
Well, all cleared up now.

Regards Anders