Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从半透明到不透明的做法难点 #14

Closed
JOKULLIU opened this issue Jul 8, 2016 · 2 comments
Closed

从半透明到不透明的做法难点 #14

JOKULLIU opened this issue Jul 8, 2016 · 2 comments

Comments

@JOKULLIU
Copy link

JOKULLIU commented Jul 8, 2016

作者你好。我现在才看到第八章透明混合。
我们项目有个需求是这样的,舰船进入场景的时候要求是半透明的,等待一定时间后由半透明渐变为不透明。那么半透明"Queue"="Transparent"。但在大部分时间里,舰船都是不透明的。
所以如果采用Transparent的做法,我猜测即便Alpha=1也是比默认的渲染队列要消耗更多资源,因为毕竟还存在Blend命令。
我有个偷懒的办法,就是准备两个材质球,一个是Transparent,一个是Geometry,让负责逻辑的程序自己去置换。
but,有没有一个好的办法可以在一个Shader里面解决呢?

@candycat1992
Copy link
Owner

换材质球的方法你是觉得有什么缺点吗?如果长时间是不透明的话,还是要换到Geometry。除了不同材质球,你也可以试试Material.renderQueue来改变渲染队列

@JOKULLIU
Copy link
Author

谢谢,我让程序用renderer.shader来置换了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants