本文介绍了阴影贴图纹理 alpha的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以修复下面的阴影贴图问题?基本上阴影贴图似乎不尊重 alpha 测试.阴影是树平面的几何形状而不是叶子的.这可能与深度写入有关吗?

Is it possible to fix the shadow map problem below? Basically the shadowmap doesn't seem to respect the alpha test. The shadow is of the tree planes geometry and not of the leaves. Would this be something to do with depth-write perhaps?

我只是使用标准THREE.MeshPhongMaterial

推荐答案

投射阴影时,从灯光的角度来看,对象被视为实体.

When casting shadows, objects are treated as solid from the point of view of the light.

但是您可以做的是指定一个使用 alphaTestcustomDepthMaterial.此自定义深度材质用于阴影计算.

But what you can do is specify a customDepthMaterial that utilizes alphaTest. This custom depth material is used in the shadow calculation.

此处有此技术的示例:http://threejs.org/examples/webgl_animation_cloth.html.

There is an example of this technique here: http://threejs.org/examples/webgl_animation_cloth.html.

three.js r.63

three.js r.63

这篇关于阴影贴图纹理 alpha的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 17:17