为了提高烟雾模拟的真实感,提出了一种基于直接投射扩散的烟雾阴影实时生成算法。该方法将3维烟雾密度场直接投射到2维平面上,并保存于光亮缓存中,首先生成一张能描述阴影浓度信息的阴影纹理;然后为了解决阴影浓度过估计问题,还新颖地采用流体力学领域的扩散方程来修正浓度分布情况;最后,在可编程图形硬件上,采取投影纹理映射技术将阴影纹理投射到场景中的相应表面。实验证明,该方法所需计算开销小,能简单高效地实时生成计算机3维游戏和动画的烟雾阴影效果。
To improve the realistic effect of smoke simulation, a real time smoke shadow simulation algorithm based on direct projection and diffusion is proposed. Firstly, the 3D smoke density field is directly projected to a 2D plane and accumulated into a light buffer to generate a texture which describes the shadow energy. Then, diffusion is used as a novel energy spread scheme to deal with the shadow excessive accumulation induced by direct projection. Finally, the shadow texture is mapped to a corresponding surface in 3D scene by projective texture based on programmable graphics hardware. Experiment results show that the algorithm is efficient, simple and effective to achieve real time smoke shadow for 3D computer games and animation.