水体的折射使水底阴影产生了扭曲,无法使用常用的阴影生成算法来直接产生水底阴影.提出一种基于GPU的快速水底阴影生成算法,其充分利用了GPU并行处理像素的能力.首先使用普通阴影算法产生水面阴影贴图,然后根据简化的折射公式快速计算出阴影贴图中每个阴影像素点的折射方向,最后利用地形连续性估算出阴影折射线和水底地形的交点来生成水底阴影贴图.实验结果表明,该算法能够在高帧速率的情况下产生真实的视觉效果,非常适用于三维游戏等实时性要求较高的应用.
Common shadow techniques fail to render the distorted shadow underwater caused by water refraction. We introduce an efficient shadow algorithm for generating underwater shadow, which is implemented on GPU by taking the advantage of its parallelism. By the algorithm, first a shadow map is generated by common shadow techniques. Then the refracted shadow rays from each shadow pixels on the shadow map are determined by a simplified refraction formula that can be evaluated quickly. Finally the underwater shadow map is rendered by approximating the intersection points between shadow rays and underwater terrain based on the continuity of the underwater geometry. Experimental result shows that the algorithm can generate visually plausible underwater shadow in high frame rate, and is suitable for the applications such as 3D games where critical real time performance is demanded.