张嘉华的专栏

GPU和图形学专栏

javazjhID:javazjh
30605次访问,排名3606好友0人,关注者2
javazjh的文章
原创 18 篇
翻译 3 篇
转载 0 篇
评论 26 篇
张嘉华的公告
欢迎访问我的blog,有空和我多多交流,QQ:188318005 email:newzjh@126.com
最近评论
xoyojank:最后一张很好玩, 像是国画
ollydbg23:你真的好牛,佩服,我最近也开始研究GPU计算,希望有机会能切磋!
mooncake123:不是一般的强啊,我就是做GPU的,算法加速,不过已经脱离了HLSL,CG之类,用cuda,看到你这么实力,我这个研究生都觉得没活的必要了,希望有机会能与你联系moon_823@yahoo.com.cn
qq:79192548
liushui899:开始搞DX10喇~`~`
lostself:你的IQ是多少?
文章分类
收藏
    相册
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 SIGGRAPH2007的一篇文章翻译:在GPU上直接处理细分曲面(Direct Manipulation of Subdivision Surfaces on GPUs)收藏

    新一篇: 关于D3D10与Geometry Shader用于细分曲面的几点学习笔记 | 旧一篇: 再添加几张非真实感水墨化、Tile化、伪HDR、运动模糊效果图

     

    GPU上直接处理细分曲面

    (Direct Manipulation of Subdivision Surfaces on GPUs)

     

    Kun Zhou    Xin Huang    Weiwei Xu    Baining Guo    Heung-Yeung Shum

    Microsoft Research Asia

     

    (a)

     (b)

    1:细分曲面形变.

    (a) 带有位移映射贴图的细分曲面形变,它的控制网格,光滑网格和位移贴图在图2展示.

    (b) 带有几何纹理的细分曲面形变.


     

    摘要

     

    我们介绍了一种针对细分曲面形变的算法,适合包括带有位移映射的细分曲面和带有几何纹理的细分曲面.我们的系统让用户自由选择曲面点作为手柄(handle)直接处理曲面.在形变过程中,控制网格的顶点自动调整以使形变曲面满足手柄位置约束.同时保持原曲面的形状和细节.为了最好地保持曲面细节,我们研究出一种梯度域方法能够结合手柄位置约束和细节保持目的到形变能量.对于位移映射细分曲面和带有几何纹理的细分曲面,形变能量是高度非线性和难以处理的在现有的迭代解决方案.为了解决这个问题,我们介绍了一种外壳形变方法,它通过两个稳定的网格形变操作代替每一个不稳定的数字上的迭代步骤.我们的形变算法近使用局部操作,因此对于GPU实现来说是稳定的.结果是比艺术级的多栅格网格形变方案更快的一个实时数量级次序形变系统(The result is a real-time deformation system running orders of magnitude faster than the state-of-the-art multigrid mesh deformation solver).我们通过一系列例子论证了我们的方法,包括通过操作带有运动捕抓数据的细分曲面实时创作可视的令人满意的角色动画.

     

    关键字:细分曲面,细节保持,位移映射(displacement mapping),几何纹理

     

    1 引言

     

    细分曲面已经广泛应用到视频创作,商业建模和游戏引擎[DeRose1998; WarrenWeimer 2002].通过细分构造曲面给计算机图形工作者带来许多问题,例如任意的拓扑,缩放性,一致性呈现,数值稳定和编码简单[Zorin et al. 2000].传统的细分曲面主要适合分段光滑建模;[Lee2000] 介绍了位移映射细分曲面以提高表现效果,该方法整合位移映射[Cook 1984]到细分框架.最近,研究人员更进一步地添加几何纹理到细分表面以使它们成为真正强大的带有复杂细节的表面建模工具.[Peng2004; Porumbescu 2005]

     

    在这篇文章,我们介绍了一种针对细分表面交互形变的算法.我们的算法有下面这些特点:

    直接处理:用户自由地在目的曲面上选择手柄以代替使用控制网格进行直接处理.为了使曲面形变,用户简单地拖曳手柄到新的位置,我们的算法自动调整控制网格适应手柄位置约束.

    细节保持:我们的算法能够在产生可视的令人的满意的形变同时有效保持曲面细节

    实时表现:我们的算法能够在GPU上实现,对于不同大小的细分曲面能够有100 FPS以上的性能表现.

     

    保持细节对于细分曲面形变是十分重要的.如果没有保持细节,形变曲面会表现出如图10所示的严重扭曲.这促使我们研究一种梯度域的细分曲面形变算法.梯度域方法最近引入到网格形变和编辑[Alexa 2003; Yu2004; Sorkine2004],由于它们能够任意保持曲面细节和产生可视的令人满意的效果是相当著名的.

     

    对于针对细分曲面的梯度域算法一个直接问题是维持细分曲面展现(An immediate issue with a gradient domain algorithm for subdivision surfaces is that of maintaining the subdivision surface representation).和现有的梯度域方法相似,我们希望直接操作细分曲面并且保持细节,与现有近生成一个形变网格方法不同的是,我们需要一个新的细分控制网格以保证形变结果真正是一个细分曲面.我们通过从曲面网格投影形变能量到控制网格达到这个目的,使用了细分细节函数(subdivision detail function)从控制网格顶点确定曲面网格顶点.

     

    一个更具挑战性的问题是形变过程中保持曲面细节,对于一个没有带有位移映射和几何纹理的细分曲面,细分细节函数是一个简单的线性函数由细分矩阵定义[WarrenWeimer 2002].在这种情况下形变能量是非线性的并且能够通过高斯-牛顿迭代方法最小化.这和子空间形变技术很相似[Huang2006],子空间形变技术使用平均数插值[Ju2005]以获得稳定快速解决方案.

     

    对于位移细分曲面和带有几何纹理的细分曲面,细分细节函数是非线性的.这导致高度非线性形变能量和高斯-牛顿迭代不在收敛[Huang2006].为了处理高度非线性能量,我们介绍了一种外壳形变解决方案.通过使用细分曲面网格作为光滑网格,在它上面叠加位移映射或者几何纹理产生细节网格以创建位移细分曲面和带有几何纹理细分曲面.光滑网格和细节网格分别来源于外壳的内边界和外边界.我们的外壳形变方案在外壳内操作,用两个稳定的形变操作代替数值上不稳定的高斯-牛顿迭代操作:一个针对优化光滑网格,另外一个针对细节网格.通过交替地优化光滑网格和细节网格,我们的方法本质上使用光滑网格形变来计算一个形变能量的高度非线性部分的好的初始值,并且使它容易处理.

     

    我们的算法能够在GPU上实现带来实时表现.关于我们算法的一个关键结论是完全通过局部操作来设计以适应GPU实现.为了平衡CPUGPU负载,并且利用GPU并行流处理的优点,我们组织细分曲面网格在纹理上如[Shiue et al. 2005].我们同样预计算需要的逆矩阵,并且把结果加载到GPU作为纹理图象.这样剩下整个迭代在GPU解决带来搞的性能.我们的GPU实现以数量级运行,比使用多栅格的艺术级的形变方案要快.(Our GPU implementation runs orders of magnitude faster than the state-of-the-art fast deformation solver using multigrids [Shi2006]

     

    伴随我们介绍的算法,能够在GPU获得高性能高质量形变结果.图1提供了我们算法的形变例子.我们将要证明我们的方法通过更多的例子,我们同样会展示我们GPU形变算法能够使一个动画创作者从静态的细分曲面和动作捕抓数据创作可视的令人满意的实时动画.


     

    2 Related Work

    Freeform deformation (FFD) [Sederberg and Parry 1986] embeds

    an object inside a volume lattice. The user deforms the object by

    manipulating the lattice points. Several extensions have been proposed

    to provide a more intuitive user interface by directly manipulating

    points [Hsu et al. 1992] or curves [Singh and Fiume 1998]

    on the object surface. A recent approach [Botsch and Kobbelt

    2005] uses volume-based radial basis functions to deform the object.

    Real-time performance on large meshes has been achieved for

    deformation with predefined handles.

    Figure 2: (a) Control mesh shown in blue. (b) Smooth mesh. (c) Displace-

    ment map. See Fig. 1 for the detail mesh of the subdivision surface.

     

     

    Energy minimization has long been used to deform smooth surfaces

    [Welch andWitkin 1992; Botsch and Kobbelt 2004]. [Boier-Martin

    et al. 2004] introduces a variational approach to deform subdivision

    surfaces. To preserve surface details, they optimize the energy of a

    deformation vector field instead of the deformation energy of vertex

    positions. With their technique the deformation result is always

    a fine mesh with a deformation vector associated with each vertex. This can be quite inconvenient when working with subdivision

    surfaces without displacements. Furthermore, since displacements

    at vertices are not texture-mapped from a displacement map, this

    approach does not scale up well as the subdivision level increases.

    Most importantly, the above technique cannot handle geometry textures

    that are not displacement maps.

    Since the introduction of hierarchical B-Spline editing [Forsey and

    Bartels 1988], multiresolution mesh editing techniques [Zorin et al.

    1997; Kobbelt et al. 1998; Guskov et al. 2000] have been developed

    for detail-preserving deformations by decomposing a mesh

    into several frequency bands. A deformed mesh is obtained by first

    manipulating the low-frequency mesh and later adding back the

    high frequency details as displacement vectors. Recently, [Marinov

    et al. 2007] mapped a two-band multiresolution deformation

    framework to the GPU. These methods do not support direct manipulation

    of the original surface. Also, the displacement vectors

    are inserted back independently at each vertex. As a result, artifacts

    can appear in highly deformed regions because details are not

    coupled and preserved uniformly over the surface.

    Gradient domain mesh deformation techniques [Alexa 2003; Yu

    et al. 2004; Sorkine et al. 2004; Sheffer and Kraevoy 2004; Zhou

    et al. 2005; Lipman et al. 2005; Nealen et al. 2005; Zayer et al.

    2005; Au et al. 2006; Huang et al. 2006; Lipman et al. 2006] cast

    deformation as an energy minimization problem. The energy function

    incorporates position constraints as well as terms for detail

    preservation. Minimization of this energy distributes errors globally

    over the entire mesh and thus leads to high quality deformation

    results. The user can directly manipulate the mesh surface and use

    the region of interest to control the scale of manipulation.

    Our algorithm combines the strengths of gradient domain techniques

    and subdivision surfaces to achieve visually pleasing deformation

    and high performance. Recently, [Shi et al. 2006] presents

    a fast multigrid solver for gradient domain mesh deformation. Unfortunately,

    their GPU implementation does not run much faster

    than the CPU version due to the unstructured nature of a general

    mesh. Thanks to the regular connectivity and locality-preserving

    data access of subdivision surfaces, our deformation algorithm can

    be efficiently implemented on the GPU, resulting in a real-time system

    which runs orders of magnitude faster than the multigrid solver

    of [Shi et al. 2006]. We deem our algorithm a nice complement

    to existing GPU-based subdivision techniques [Bolz and Schr ¨oder

    2004; Shiue et al. 2005].

    Deformation is an active research area and the above review only

    summarizes techniques most relevant to our work. Other deformation

    approaches include example-based mesh deformation [Sumner

    et al. 2005; Der et al. 2006], vector field based shape deformation

    [von Funck et al. 2006], and volumetric prism based deformation

    [Botsch et al. 2006].


     

    3 细分曲面形变

     

    在这篇文章,一个三角网格 由一个元组 表示,K是一个抽象的单纯复形包括网格的连接信息, 是一个3m维向量,每一个 代表一个顶点位置.

     

     

    3.1 拉普拉斯形变

     

    我们首先随着[Sorkine2004;Yu2004]关于网格的拉普拉斯曲面编辑方案得到一个细分曲面直接处理的公式.细分曲面的控制网格 带有顶点集 如图2所示.从控制网格 通过细分 到一定期望层次得到一个带有顶点集 光滑网格 .接着在光滑网格 上应用位移贴图[Lee2000]或细节纹理[Peng2004]生成带有顶点集 细节网格

     

    细节网格 是我们希望通过直接处理形变得到的细分曲面.我们通过最小化下面的能量函数进行 的拉普拉斯形变:

     

                  (1)

     

    其中 的拉普拉斯操作矩阵, 的拉普拉斯坐标 是位置约束矩阵, 是约束顶点(直接处理中的顶点)的目标位置. 由于包括局部旋转是顶点位置的非线性函数.我们必须保证形变结果仍然是细分曲面.为此,我们根据控制网格顶点 重写方程(1).通过细分,位移映射和几何纹理映射,细节网格 的顶点可以从 如下计算:

     

    其中函数 由细分规则,位移映射和纹理映射规则决定.我们称 是细分细节函数(subdivision detail function).对于一个不带有位移映射和几何纹理的细分曲面, 是由细分矩阵定义的简单的线性函数.但普遍来说 是一个复杂非线性函数.通过用 代替 ,方程(1)可以改写为如下:

     

              (2)

     

    这是细分曲面拉普拉斯形变的基本公式.首先为控制网格 的顶点集 计算方程(2),然后应用细分规则,位移映射和几何纹理以达到形变细节网格 .图3提供一个通过直接处理的细分曲面形变例子.接下来我们介绍如何处理方程2,首先以简单的例子开始,这个例子中位移映射和几何纹理暂不考虑, 是简单的光滑网格


     

    3.2 光滑曲面形变

     

    上一节提到位移映射和几何纹理暂不考虑, 以光滑网格 代替,因此这里简单地把细分细节函数 作为一个线性函数,让 为控制网格 的第 层细分曲面网格,并且 细分矩阵是 ,其中 的细分矩阵.细分细节函数 是由细分矩阵定义的线性函数.伴随着 是一个线性函数,那么方程(2)变为:

     

    把系数提出来可以简写为下面的形式:

                   (3)

     

    其中 是光滑曲面 的拉普拉斯操作矩阵,接着我们考察 .这里我们用 代替 强调它和 的关系.注意到由于 [Huang2006]一样是非线性的,所以 的非线性函数,方程(3)能够通过不确定高斯-牛顿方法[Steihaug 1995]解决.

                   (4)

     

    在每次迭代中, 是已知的并且方程(4)能够以最小平方问题(a least squares problem)解决.

                (5)

     

    3.3 外壳形变

     

    针对光滑曲面形变的不精确高斯-牛顿方法本质上通过下面线性化:

     

       (6)


     

    其中