针对扫描转换多边形时,逐像素计算准确的纹理坐标需要用到除法运算,效率较低的问题,提出一种使用线性插值代替除法运算的纹理坐标计算方法.该方法以与屏幕平行的平面切割多边形形成的线段来对多边形进行光栅化,可以线性插值的方式实现纹理坐标在透视投影下的正确计算,消除了一般光栅化计算中所需要的除法运算;对于离散化所引起的插值误差,通过增加误差修正操作进行改进.实验结果表明,采用文中方法能较好地提高计算效率,并得到计算精度很高的纹理坐标.
Existing algorithms for pixel rasterization and texture coordinate interpolation always need per-pixel division operations,severely limiting the computation efficiency.This paper presents a new algorithm with only linear computation,and so achieves much acceleration.The new algorithm decomposes a 3D polygon into a set of line segments with the planes parallel to the viewing plane,and uses the obtained line segments for pixel rasterization and texture coordinate interpolation.As the line segments are parallel to the viewing plane,texture coordinates can be computed with linear interpolation,without the expensive division operations.For the errors from such a rasterization,simple supplementary measures are provided for correction to get high precise results.Experimental results have shown the effectiveness and efficiency of the new algorithm.