ogre 透明材质物体的实现

博客围绕Lua材质设置展开,介绍通过改变材质漫反射颜色的alpha分量,在材质脚本中使用“scene_blend alpha_blend”和“depth_write off”实现透明效果。还指出实现后存在渲染顺序问题,加入“alpha_rejection greater_equal 128”和“cull_hardware none”可完美解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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, 就完全可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值