Unity-如何使材料双面 [英] Unity - how to make material double sided

查看:248
本文介绍了Unity-如何使材料双面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

搜索问题提供了许多解决方案,但是由于我的Unity3D 5.4中的某些原因,它们无法正常工作.喜欢 球体内的摄像头

Search for the issue gives a number of solutions, but they don't work for some reason in mine Unity3D 5.4. Like camera inside a sphere

我在Unity编辑器的材料中看不到cull和/或sides. 在C#中

I do not see cull and/or sides in material in Unity editor. In C#

rend = GetComponent<Renderer>();
mater = rend.material;
rend.setFaceCulling( "front", "ccw" );
mater.side = THREE.DoubleSide;

没有这样的setFaceCullingside属性.

如何使材料双面化?

推荐答案

您需要自定义着色器,才能使用Cull Off启用双面材质 最简单/最快的测试方法是在编辑器中创建一个新的Standard Surface Shader并将其打开.在LOD 200下面添加Cull Off行.

You need a custom shader to enable double sided material by using Cull Off The easiest/fastest way to test is to create a new Standard Surface Shader in the editor and open it. Add the line Cull Off below LOD 200.

现在要考虑的一件事是,闪电将无法正确渲染背面.如果需要的话,我建议您制作两边的模型.

Now one thing to consider is that lightning will not render correctly for the back faces. If you want that, I would recommend doing models with 2 sides.

这篇关于Unity-如何使材料双面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆