Thanks for the quick reply. I thought that might be the case.
However based on that logic, I should be able to do the following in the vertex shader (where input.pos is in model/object space passed into the VS).
Code:
Vec worldSpace = Transform(input.pos, MatrixOC0*MatrixCam);
Vec viewSpace = Transform(worldSpace, -MatrixCam);
Vec projSpace = Project(viewSpace);
return projSpace;
However this gives me a very different result from doing this.
Code:
Vec viewSpace = TransformPos(input.pos);
Vec projSpace = Project(viewSpace);
return projSpace;
In addition, this gives a completely different result again.
Code:
Vec worldSpace = Transform(input.pos, MatrixOC0);
worldSpace = Transform(worldSpace, MatrixCam);
Vec viewSpace = Transform(worldSpace, -MatrixCam);
Vec projSpace = Project(viewSpace);
return projSpace;
Shouldn't all three of these give an identical result?
On a side note, are there any constants for the main directional light source, such as its direction vector? I found SkySunPos in Sky.h. Is that the direction of the sun light?
Is there a list of scene lights passed in somewhere?