[Unity]场景中影子消失的问题与解决

写在前面:该问题仅当Camera的RenderingPath为Forward的时候才会有,设为Deferred时没有这个问题。

Unity中当QualitySetting设为Fastest时,默认Pixel Light Count是0,有时进场景会发现模型的影子都没了,原因其实是场景中的所有Light光强(Intensity)一样,而RenderMode又都选了Auto或者Not Important,这时Unity挑不出最重要的一盏灯,然后PixelLightCount又是0,也就是没强求Unity挑一盏,于是它就放弃了。

解决方法:在不增加Pixel Light Count的情况下,要么把最重要的一盏灯的Intensity调亮,要么直接把它设成Important,Unity就知道这盏灯是要挑出来保留的了。


相关文档:https://docs.unity3d.com/460/Documentation/Manual/RenderTech-ForwardRendering.html



补充:

  • Lights that have their Render Mode set to Not Important are always per-vertex or SH. 
    渲染模式被设置为不重要(Not Important)的光源以逐顶点或球面调和的方式进行计算
  • Brightest directional light is always per-pixel. 
    最亮的方向光源为像素光源
  • Lights that have their Render Mode set to Important are always per-pixel. 
    渲染模式被设置重要(Important)的光源为像素光源
  • If the above results in less lights than current Pixel Light Count Quality Setting, then more lights are rendered per-pixel, in order of decreasing brightness. 
    如根据以上规则得到的像素光源数量小于质量设置中的像素光源数量(Pixel Light Count),为了减少亮度,会有更多的光源以逐像素的方式进行渲染

猜你喜欢

转载自blog.csdn.net/tlrainty/article/details/60769818
今日推荐