|

楼主 |
发表于 2010-9-28 10:24:00
|
显示全部楼层
Re:粒子贴地问题
2D软粒子
In the basic flat particle system, the line where the particle quad intersects the geometry is a giveaway that the particles are not actually 3D. To avoid this, the sample can read back the depth buffer as a texture. In the shader, this depth value is sampled and tested against the depth value being rendered for the current pixel in the particle. The alpha value increases as the difference between the depth value in the buffer, and then depth being written out from the pixel shader decreases. Therefore, the particle becomes more transparent as it approaches intersection with the scene geometry.
在基本的平坦粒子系统中,由于矩形粒子与几何体交叉产生的线使人感觉到它不是真正的3D。为了避免这个问题,这个实例把深度缓存作为一个纹理。在着色器中,这个深度值和当前正要被渲染的粒子像素的深度值进行比较和采样。ALPHA值作为区别增加缓存中深度值,然后像素着色器中再输出减少的深度。这样粒子越靠近场景中的几何体,粒子就越变的透明。
这个技术是用来解决粒子和地表融合的问题,好像不是解决粒子贴地问题。
|
|