问题描述
搜索问题提供了许多解决方案,但是由于我的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. Likecamera 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;
没有这样的setFaceCulling
和side
属性.
如何使材料双面化?
推荐答案
您需要自定义着色器,才能使用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-如何使材料双面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!