纹理坐标采样的计算方法

像素和纹素,都是点,像素是左上角第一个像素为中心开始计算;

纹素,以左上角的点为中心开始计算的;

存取纹理时,D3D的像素中心不在纹理点的中心,所以要偏半个像素,也就是:

纹理坐标U = u +0.5 * (1 / screenSize.x);

           V = v + 0.5 * (1 / screentSize.y) ;

参考:http://www.cnblogs.com/ttthink/archive/2009/10/13/1582588.html

http://www.opengpu.org/bbs/forum.php?mod=viewthread&tid=2912

http://www.25k5.com/s_diannao/22982.html

posted @ 2013-11-13 17:55  小 楼 一 夜 听 春 雨  阅读(1389)  评论(0编辑  收藏  举报