The standard Quake sky warp is now completed. Once again I ran into an almost undocumented "feature" of Direct3D, which I had encountered before but which hadn't become an issue until now. This time it's texture matrix transforms and the issue is to do with where in the matrix the transforms are stored.
To elaborate, here's a standard translation matrix which is used by everything else:
And here's a translation matrix for the texture matrix:
The big deal here is that you can't use the same code for transforming the texture matrix as you would use for anything else. And where is it documented? Where would you or I document it? I know I'd put it in the description of maybe the D3DXMatrix* functions, and perhaps in the general overview of matrices, and perhaps also in the Texture Coordinate Transformations section. Microsoft however chose to mention it in the "Special Effects" section, purely in passing, in sample code rather than in a general discussion, and without drawing any attention whatsoever to the fact that hey! this might be different!
Here is the sum total of the documentation of this "feature", preserved for posterity:
Sigh.
Saturday, August 8, 2009
Sky warp is done
Posted by
mhquake
at
10:34 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment