ogre 透明材質物體的實現

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章