c# - Unity 和 C# : How to change overall world lighting not just ground? 其他对象未使用 RenderSettings 点亮?

标签 c# unity3d lighting skybox

我刚刚开始使用 Unity 3d 进行照明,现在有一个功能可以逐渐加深我这里场景的照明。我已经通过渲染设置完成了这项工作,并尝试了 3 种不同的光照方法,我都收到了相同的结果:

                RenderSettings.ambientLight = Color.Lerp (RenderSettings.ambientLight, colors2 [currentColor], changeTime * Time.deltaTime);
                RenderSettings.ambientSkyColor = Color.Lerp (RenderSettings.ambientSkyColor, colors [currentColor], changeTime * Time.deltaTime);
                RenderSettings.ambientGroundColor = Color.Lerp (RenderSettings.ambientGroundColor, colors2[currentColor], changeTime*Time.deltaTime);

我并不完全理解所有这些之间的区别,并且在照亮世界时遇到了问题 - 当颜色发生变化时,天空和地面的颜色(与坐着的其他游戏对象 block 具有相同的 Material )在它上面)根据照明变化。即我的白色地面变成橙色。

问题是我地面上的方 block (使用标准着色器的相同 Material )没有受到相同程度的影响/照亮。它们通常保持白色/不受影响,而我的地面一直是橙色。无论我是更改 ambientGroundColor 还是 SkyColor,都会发生这种情况。

如何均匀地照亮整个场景?这里出了什么问题?

问题:

enter image description here

最佳答案

Unity 实现的光照系统通常结合了实时光照和预计算光照。您看到的影响地面的环境光可能是预先计算好的。然而,地面上的方 block 不包括在预计算光照中。因此,将这些 block 标记为 static 会将它们添加到预计算光照中,但也会使它们在运行时不可编辑。查看下面的链接以获取更多信息。

长话短说:

Only static geometry is considered by Unity’s precomputed lighting solutions. To begin the lighting precompute process we need at least one GameObject marked as ‘static’ in our scene. This can either be done individually, or by shift-selecting multiple GameObjects from the hierarchy panel.

Quoted from the unity 5 documentation about lighting and rendering

关于c# - Unity 和 C# : How to change overall world lighting not just ground? 其他对象未使用 RenderSettings 点亮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37468633/

相关文章:

c# - 计算 Minecraft 爆炸

unity3d - 实现 Kinect 和 Unity 3D 集成的概述

math - 简单的球形照明

java - 更新基于图 block 的游戏中的光照

c# - Selenium WebDriver : unable to locate element (C#)

c# - BodyFrameReader.AcquireLatestFrame 总是返回 null

c# - 间歇性 "unable to connect to remote server"错误

opengl - 如何在OpenGL中表示光源的状态

c# - 尝试编辑不存在的项目的最佳实践?

C#缓存缓存依赖的使用