[Aqsis-commits] SF.net SVN: aqsis: [1951] branches/texfiltering/aqsis/texturing/texlib/ shadowsampl
Brought to you by:
ltatkinson,
pgregory
From: <c4...@us...> - 2008-02-26 02:45:27
|
Revision: 1951 http://aqsis.svn.sourceforge.net/aqsis/?rev=1951&view=rev Author: c42f Date: 2008-02-25 18:45:10 -0800 (Mon, 25 Feb 2008) Log Message: ----------- * Small fix to some terminology and a variable name for clarity and correctness. Modified Paths: -------------- branches/texfiltering/aqsis/texturing/texlib/shadowsampler.cpp Modified: branches/texfiltering/aqsis/texturing/texlib/shadowsampler.cpp =================================================================== --- branches/texfiltering/aqsis/texturing/texlib/shadowsampler.cpp 2008-02-25 02:24:45 UTC (rev 1950) +++ branches/texfiltering/aqsis/texturing/texlib/shadowsampler.cpp 2008-02-26 02:45:10 UTC (rev 1951) @@ -63,16 +63,16 @@ file->readPixels(*m_pixelBuf); // Get matrix which transforms the sample points to texture coordinates. - const CqMatrix* worldToLightRaster = header.findPtr<Attr::WorldToScreenMatrix>(); - if(!worldToLightRaster) + const CqMatrix* worldToLightScreen = header.findPtr<Attr::WorldToScreenMatrix>(); + if(!worldToLightScreen) { AQSIS_THROW(XqBadTexture, "No world -> screen matrix found in file \"" << file->fileName() << "\""); } - m_camToLightTexCoords = (*worldToLightRaster) * camToWorld; - // worldToLightRaster transforms world coordinates to NDC, ie, onto the 2D - // box [-1,1]x[-1,1]. We instead want texture coordinates, which - // correspond to the box [0,1]x[0,1]. In addition, the direction of + m_camToLightTexCoords = (*worldToLightScreen) * camToWorld; + // worldToLightScreen transforms world coordinates to "screen" coordinates, + // ie, onto the 2D box [-1,1]x[-1,1]. We instead want texture coordinates, + // which correspond to the box [0,1]x[0,1]. In addition, the direction of // increase of the y-axis should be swapped, since texture coordinates // define the origin to be in the top left of the texture rather than the // bottom right. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |