Unity3D高级手册0502:使用阴影常见错误

2014-08-29 20:39:22|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:游戏, 虚拟现实, Unity3D|来源:唯设编程网

Unity Manual > Advanced > Shadows in Unity > Troubleshooting Shadows

Unity手册->高级->Unity中的阴影->阴影疑难解答

This page lists solutions to common shadow problems.  此页面列出了公共的阴影问题的解决办法。

I see no shadows at all! 我根本看不到阴影

Shadows are a Unity Pro only feature. If you have Unity Indie, you won't get shadows. Simpler shadow methods, like using a Projector, are still possible of course.  阴影是一个Unity专业版本唯一的功能。如果你是Unity的独立版本,你将不会得到阴影。简单的阴影的方法,像使用一个投影机,是可行的做法。

Shadows also require certain graphics hardware support. See Shadows page for details.  阴影还需要一定的图形硬件支持。详情请参阅阴影网页。

Check if shadows are not completely disabled in Quality Settings.  检验,在质量设置里,阴影不能设置为禁用。

Some of my objects do not cast or receive shadows我的一些对象不能消除或接收阴影

First, the Renderer has to have Receive Shadows on to have shadows on itself; and Cast Shadows on to cast shadows on other objects (both are on by default).  首先,渲染器在它自己身上的阴影必须接收阴影,并使人对其它物体阴影投射阴影(两者都默认情况下)。

Next, only opaque objects cast and receive shadows; that means if you use built-in Transparent or Particle shaders then you'll get no shadows. In most cases it's possible to Transparent Cutout shaders (for objects like fences, vegetation etc.). If you use custom written Shaders, they have to be pixel-lit and use Geometry render queue. Objects using VertexLit shaders do not receive shadows either (but can cast shadows just fine).

其次,只有不透明物体投下阴影和接收阴影,这意味着如果你使用内置的透明或粒子的着色器,然后你会得到没有阴影。在大多数情况下是可能的透明抠图着色(像围栏对象,植被等)。如果你使用常规的书面阴影,它们必须像素照明,并用几何渲染队列。对象使用VertexLit着色也不会收到任何阴影(但恰好可以投下阴影)。

Finally, only Pixel lights cast shadows. If you want to make sure that some light always casts shadows, no matter how many other lights are in the scene, set it to Force Pixel render mode (see Light documentation).

最后,只有像素灯投射阴影。如果你想确保一些光源总是蒙上阴影,无论有多少其它光源在场景中的,将它设置为强制像素渲染模式(见光源文档)。

发表评论0条 】
网友评论(共?条评论)..
Unity3D高级手册0502:使用阴影常见错误