系统仿真学报 ›› 2018, Vol. 30 ›› Issue (4): 1279-1286.doi: 10.16182/j.issn1004731x.joss.201804009

• 仿真建模理论与方法 • 上一篇    下一篇

一种基于GPU构造阴影线的软阴影绘制算法

高山晓, 吴献   

  1. 福建师范大学软件学院,福建 福州 350108
  • 收稿日期:2016-04-20 修回日期:2016-07-03 出版日期:2018-04-08 发布日期:2019-01-04
  • 作者简介:高山晓(1990-),男,福建福州,硕士生,研究方向为计算机图形学。
  • 基金资助:
    福建省自然科学基金青年创新项目(2012J05111); 福建省教育厅自然科学基金面上项目(JA12079); 福建师范大学教学改革研究项目(I201503039)

Soft Shadow Rendering Algorithm Based on GPU’s Shadow Line

Gao Shanxiao, Wu Xian   

  1. Fujian Normal University Faculty of Software, Fuzhou, 350108, china
  • Received:2016-04-20 Revised:2016-07-03 Online:2018-04-08 Published:2019-01-04

摘要: 为解决阴影体算法中软阴影绘制问题,提出了一种基于GPU构造阴影线的软阴影绘制算法,通过GPU构造遮罩体阴影线数据集,该数据集包含了阴线的起始点,终止点,遮罩值3个数据。在阴影遮罩值修正阶段,使用计算渲染管线(computer shader,CS)对数据集采用反距加权函数进行修正。在绘制受影体阶段根据遮罩体的阴影线数据集,采用三角插值计算出当前像素点的阴影值。实验证明,该算法能有效解决阴影体算法绘制软阴影问题,并且在满足实时渲染需求的同时能渲染出灵活可控过渡自然的软阴影。

关键词: 阴影体, 几何着色器, 计算渲染管线, 软阴影渲染

Abstract: To solve the problem of soft shadow rendering algorithm on shaded body surfaces, a new algorithm based on shadow lines which can render better soft shadow with less cost computation overhead is presented. GPU is used to create shadow lines which include starting point, ending point and shading value. The computer shader (CS) is used to amend the shading value by inverse distance weighting function. In the phase of shadow rendering, the shadow lines dataset is used to calculate the current pixel's shading value by trigonometric interpolation. Experimental result shows that the algorithm can solve the soft shadow rendering problem effectively. It can not only meet the needs of real-time rendering, but also give out the flexible and adjustable soft shadows.

Key words: shaded bodies, geometric shader, computer shader, soft shadow rendering

中图分类号: