subtractive模式

https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html

subtractive mode

subtractive mode is a lighting mode shared by all mixed lights in a scene. to set mixed lighting to subtractive, open the lighting window (menu: Window->Rendering->Lighting Settings), click the scene tab, navigate to mixed lighting and set the lighting mode to subtractive. see documentation on mixed lighting to learn more about this lighting mode, and see documentation on light modes to learn more about the other modes available.

subtractive is the only mixed lighting mode that bakes direct lighting into the light map, and discards the information that unity uses to composite dynamic and static shadows in other mixed lighting modes. because the light is already baked into the lightmap, unity can not perform any direct lighting calculations at run time.

in subtractive mode:

1/ static game objects do not show any specular or glossy highlights at all from mixed lights. they also can not receive any shadows from dynamic game objects, except for the main directional llight (see paragraph below fore more information on this).

2/ dynamic game objects receive real-time lighting, and support glossy reflections. however, they can only receive shadows from static game objects via light probes.

in subtractive mode, the main directional light (which is usually the sun) is the only light source which casts real-time shadows from dynamic game objects onto static game objects. shadows cast from static game objects onto other static game objects are baked into the lightmap, even for the main light, so unity can not guarantee correct composition of baked and real-time shadows.

subtractive mode therefore hs a realtime shadow color field. unity use this color in the shader to composite real-time shadows with baked shadows. to do this, it reduces the effect of the light map in areas shadowed by dynamic game objects. because there is no correct value that the engine can predetermine, choosing a value that works for any given scene is down to your own artistic choice.

a good example of when subtractive mode might be useful is when u are building a cel-shaded (that is, cartoon-style) game with outside levels and very few dynamic game objects.

shadows
the following table shows how static and dynamic game objects cast and receive shadows when using subtractive mode:

在这里插入图片描述

advantages and disadvantages of subtractive mode
the performance requirements of subtractive mode make it a good option for building to low-end mobile devices. these are the most significant advantages and disadvantages of using subtractive mode:

advantages:
1/ it provides high-quality shadows between static game objects in iightmaps at no additional performance requirement.
2/ one texture operation in the shader handles all lighting and shadows between static game objects.
3/ it provides indirect lighting.

disadvantages:
1/ it does not provide real-time direct lighting, and therefore does not provides specular lighting.
2/ it does not provide dynamic shadows on static game objects, except for one directional light (the main light).
3/ it only provides low-resolution shadows from game objects onto dynamic game objects, via light probes.
4/ it provides inaccurate composition of dynamic and static shadows.
5/ it has increased memory requirements for the light map texture set (compared to no lightmaps).

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值