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

第8章 8.7 双面渲染的透明效果 p176 p177 背面法线方向问题 #327

Open
yu-xiaowen opened this issue Oct 21, 2022 · 0 comments

Comments

@yu-xiaowen
Copy link

我感觉可以改进一点,透明度混合的双面渲染,渲染背面的 Pass 里,计算漫反射那行可以改成
fixed3 diffuse = _LightColor0.rgb * albedo * max(0, - dot(worldNormal, worldLightDir));
就是在 dot 前加负号,因为背面的法线方向是反的,修改前直接光没效果,只有环境光。
另外透明度测试的双面渲染,也可以分成两个 Pass,这样修改。

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

1 participant