author: lua date:2005-8-12
Your best bet would be to vary the alpha component of the diffuse color of the material, ie, pass->setDiffuseColour
This is then used as alpha value for the entire material.
Make sure to use "scene_blend alpha_blend" and "depth_write off" in the material script for transparent objects
设置一幅具有alpha通道的图片到diffuse colour(应该是默认方式), 在材质中加入scene_blend src_alpha one_minus_src_alpha
和depth_write off选项即可.
2005/12/22补充:以上方法实现了之后,会有显示渲染顺序问题,完美解决方法是:
在材质定义中加入下面两句 alpha_rejection greater_equal 128 cull_hardware none, 就完全可以了。
博客围绕Lua材质设置展开,介绍通过改变材质漫反射颜色的alpha分量,在材质脚本中使用“scene_blend alpha_blend”和“depth_write off”实现透明效果。还指出实现后存在渲染顺序问题,加入“alpha_rejection greater_equal 128”和“cull_hardware none”可完美解决。
1576

被折叠的 条评论
为什么被折叠?



