Unity optimized lighting

light

Shadow Type The type of shadow:

1, No Shadows: no shadows, no shadows are displayed

2, Soft Shadows: soft shadows, more performance-consuming, less anti-aliasing

3, Hard Shadows: hard shadows, less performance consumption, greater anti-aliasing

Lightmapping

Windowns->Rendering->Lighting(Scnen)

Mixed Lighting

Lighting Mode

Here we first explain the distance from the model to the camera set in Project Setting->Quality->Shadow Distance.

Secondly, when the model can produce shadows and the light can produce shadows, when the light is set to Baked mode, it will produce shadows in lightmapping.

Finally: The following modes are effective when the light is set to Mixed

  • In Baked Indirect mode

Static models within the Shadow Distance distance use real-time light, otherwise use lightmapping shadows.

  • Shadowmask与Subtractive

Lightmapping shadows are used regardless of the Shadow Distance distance.

The difference refers to the figure below: Subtractive

Lightmapping Settings

  • What hardware does Lightmapper use for rendering? It is divided into GPU and CPU. The default is CPU, but CPU is slow. We generally choose GPU here. GPU is generally 10-50 times faster than CPU, depending on the performance of the graphics card.

  • Prioritize View: After checking, the part seen in the window will be rendered first (in this way, we can quickly preview the indirect lighting information of the current screen in the Scene window, and make corresponding changes in time)

  • Multiple ImportanceSampling: (default is disabled) This is the setting for ambient light sampling. If enabled, can reduce lightmap generation time, but can produce noticeable noise in some dark places in the scene.

  • Direct Samples: Used to set the number of sampling paths emitted from each texel (for direct lighting). The larger the value, the better the effect and the longer the baking time.

  • 间接光采样数 ,影响间接光照烘焙质量,数值越大效果越好,烘焙越慢,这个值一般是 DirectSamples 的10倍,建议预览时用小值,最终烘焙时用大值

  • Environment Samples:针对环境光的采样数。数值越大效果越好,烘焙时间也越长。默认数值为500。

  • Light Probe SampleMultiplier:如要使用此功能,必须在Project Settings > Editor> Graphics中禁用Use legacy Light Probe sample counts,如下图所示:

此数值会被用于分别乘以Direct Samples,Indirect Samples和Environment Samples这三个数值。这三个数值会被应用于LightProbes采样。数值越大效果越好,烘焙时间也越长。

  • Bounces:此数值用于控制计算光子弹射时的反弹次数,一般2次可以满足普通场景的需求。

  • Filtering 降噪

  • Lightmap Resolution 分辨率大小,值越大效果越好但内存占用也会越高

  • Lightmap Padding 光照贴图间距

  • Max Lightmap Size 贴图大小

  • Compress Lightmaps 压缩灯光贴图

  • AmbientOcclusion 环境遮蔽除噪器

  • Directional Mode(方向模式):

Directional:此模式下会生成第二套光照贴图,专门用于保存入射光的主要方向信息。使用法线贴图的材质可以利用这张光照贴图上的方向信息,在计算法线贴图时加入光照贴图中保存的全局光照信息。不过此模式下生成的光照贴图通常比Non-Directional模式下生成的光照贴图大一倍。(此模式下生成的光照贴图无法在SM2.0和GLES2.0硬件上解码使用。在这些硬件上会回退到Non-Directional模式)。

Non-Directional:禁止烘焙时生成第二套用于保存入射光主要方向信息的光照贴图。

  • Indirect Intensity(间接光强度):用于控制光照贴图中保存的间接光强度。数值限定在0到5之间。默认数值为1。数值大于1会增强间接光强度,小于1会减弱间接光强度。

  • Albedo Boost(反射率增强):用于控制物体表面之间光子弹射的数量。默认数值为1。数值限定在1到10之间。数值越大,物体表面的反射率越趋向于白色。

Guess you like

Origin blog.csdn.net/st75033562/article/details/129565693