由于现有的体纹理生成方法难以快速生成与指定样图相似的体纹理,针对大理石与木材2种典型的纹理类型,提出一种基于二维样图快速生成体纹理的算法.根据纹理的空间分布特征设计二维样图在三维空间中的运动路径,然后使样图像素通过其运动轨迹对三维空间着色,生成体纹理空间;设计了五次Catmull—Rom样条函数用于噪声插值,以此构造湍流函数扰动样图运动轨迹,模拟实际纹理的不规则性;采用基于三角形最长边垂直放置与高度递减装配策略的纹理地图集生成算法,用于保存从体纹理空间获取的表面纹理.实验结果表明,该算法能够在网格表面生成高度真实感的体纹理,有效地保持了与样图纹理的相似性,运行时间仅需几秒钟.
The existing methods have difficulties in fast generation of solid texture similar to a given sample. Considering the typical marble and wood textures, this paper presents an efficient technique for fast generation of solid texture from 2D sample. According to the spatial distribution of the texture, the movement path for 2D sample is designed in 3D space. All the pixels of the sample are then used to colorize the 3D space along their trajectory so that the solid texture is obtained. The quintic Catmull Rom spline is designed for noise interpolation to construct turbulence, which is adopted to disturb pixel trajectory to simulate the irregularities of the natural texture. By placing triangles vertical to their longest side and assembling triangles in descending order according to the heights, a novel texture atlas generation algorithm is presented to store mesh texture obtained from the solid texture space. Experimental results show that the algorithm only takes a few seconds to generate highly realistic solid texture on mesh surfaces, which is very similar to the sample texture.