针对基于阴影图算法扩展的一些近似软影算法中存在的只考虑外半影区而导致的本影区过多估计的问题,提出了一种深度剥离与GPU结合的近似软影实时绘制算法。算法利用GPU的几何着色器来提取场景物体的轮廓边并生成内半影和外半影图元,进而得到整个内外半影颜色图和深度图,最终阴影绘制的时候通过参考阴影图和内外半影图来确定每个可见像素的明暗值,从而得到比以往算法较真实的绘制效果,算法完全在GPU中实现。实验结果表明,对相对不复杂的场景,该算法可以生成较真实的软影效果,且绘制帧率完全达到实时。
To deal of umbra overestimation in some current soft shadow algorithms considering only the outer penumbra effects extended from traditional shadow mapping, a real-time approximating algorithm for plausible soft shadows based on depth peeling is proposed. The algorithm extracts the scene silhouette edges in geometry shader and generates the inner and outer penumbra primitives respectively through the silhouette edges. In the final rendering pass, the shading of each pixel is decided by referring to the shadow map and penumbra map, and plausible soft shadow effect which is more realistic than the results of previous methods is finally simulated. This algorithm runs entirely on GPU. Several experimental results show that, this algorithm generates more plausible soft shadows for relatively uncomplicated scenes than other methods and has real-time rendering speed.