计算机工程与应用 ›› 2011, Vol. 47 ›› Issue (11): 1-2.

• 博士论坛 • 上一篇    下一篇

GPU加速的光滑轮廓线绘制

方建文1,2,于金辉2   

  1. 1.衢州学院 信息与电子工程系,浙江 衢州 324000
    2.浙江大学 CAD&CG国家重点实验室,杭州 310058
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2011-04-11 发布日期:2011-04-11

GPU accelerated rendering smooth silhouettes

FANG Jianwen1,2,YU Jinhui2   

  1. 1.Department of Information and Electronic Engineering,Quzhou College,Quzhou,Zhejiang 324000,China
    2.State Key Laboratory of CAD&CG,Zhejiang University,Hangzhou 310058,China
  • Received:1900-01-01 Revised:1900-01-01 Online:2011-04-11 Published:2011-04-11

摘要: 轮廓线的高效提取是非真实感绘制的一个关键问题。提出了一个完全利用GPU生成光滑轮廓线的高效算法。在几何处理阶段,先根据相邻三角形的法向量与视向量的关系检测出轮廓线,然后对轮廓线进行宽度扩充,同时对轮廓线顶点设置相应的渐变因子;在像素处理阶段把渐变因子转化为相应的alpha值,通过光照生成卡通渲染,最后通过alpha混合得到光滑轮廓线。算法完全在GPU里实现,能满足实时的绘制要求。

关键词: 图形处理器, 卡通风格, 实时绘制

Abstract: Efficient silhouette extraction is a key issue in non-photorealistic rendering.This paper presents an algorithm that is able to generate smooth silhouettes entirely in GPU.In the geometry shader stage,silhouettes are detected according to the relations between the normal vectors of two adjacent triangles and the view vector,and then the silhouette is extruded and a fade factor is set for each silhouette vertex.In the pixel shader stage,the fade factor is translated into pixel alpha channel value,cartoon style is generated based on the light direction and finally smooth silhouettes are obtained after alpha blending with frame buffer.Algorithm is implemented entirely in the GPU and it can meet the real-time rendering requirements.

Key words: Graphic Processing Unit(GPU), cartoon style, real-time rendering