A Preliminary Study on the Global Illumination GI of Unity 5 and the new baking system, unitygi

Source: Internet
Author: User
Tags unity 5

A Preliminary Study on the Global Illumination GI of Unity 5 and the new baking system, unitygi
What is GI?

Realtime GI, real-time global lighting, sounds like a very tall word, but the higher the size, the more awesome it is, because there is no free lunch in the world, the better the effect, it means more consumption. For mobile platforms, this consumption is not affected? First of all, let's say what GI is doing. In a rough description, if our previous lighting system was composed of a light source, an object, and a viewpoint, the Global illumination system is composed of light source-n multi-environment reflected light-object-viewpoint. That is to say, GI includes the calculation of ambient reflected light, which makes the interaction between light and shade between rendered scene objects more realistic.

If it is offline baking, more than n environmental reflected light is calculated by the radiation degree algorithm or the light tracing algorithm, but real-time rendering does not take so much time. To implement real-time GI, in short, Unity (Enlighten GI) needs to pre-calculate some information, which may include the location and reflection relationship between objects in different scenes, and an environment reflection tree (these are all guessed by me). during real-time rendering, using this information, Unity will dynamically generate an indirect illumination map, like the original Lightmap, only the above information is recorded about the indirect light on the object surface. In this way, during real-time rendering, we can see that the object is affected by the reflected light.

Therefore, Unity GI has the following features:

The GI overhead mainly includes:

GI and Lightmap

We can see that the additional performance consumption of GI is acceptable. I tested it on my mobile phone, even in a very big and complex scenario, there is no problem at all (of course, because I tested it on iPhone 6 ). But in most cases, if there is no light change or dynamic self-emitting material in your scenario, or a fixed lens (yes, I am talking about RPG ), GI is still useless for games. All the operations that GI can do can be achieved with simple Lightmap. Now the problem is that Unity has developed a new baking system with GI. How can this system be used.

First, you must understand whether the indirect illumination graph and scene tree information used by Realtime GI is Static Lightmap, then, we can determine whether the light source type is Realtime/Mixed/or Baked. First, the baking method. In the Lighting panel, Precomputed Realtime GI and Baked GI correspond to the baking of Realtime GI and Static Lightmap respectively.


There are three types of combinations ):

Bake RealtimeGI only

Disable Baked GI or set all light source types in the scenario to Realtime. This means that no light color will be pre-baked, and the engine only stores the relationship between static objects in the scenario during baking. After baking, you can adjust the light source or object material freely, and see the effect in real time.
Observe the Baked result in Scene and you can see that no static color is Baked.

When you only use RealtimeGI, you should select the Realtime type as the light source. The baking option Realtime Resolution corresponds to the indirect illumination graph mentioned above. The higher the value, the more obvious the indirect light effect (in fact, the more accurate, when the resolution is too low, the received light will become weak due to pixel filtering)
Realtime Resolution = 10

Realtime Resolution = 1

Only bake Static Lightmap

Deselect the Precomputed Realtime GI check box to bake the same pure static lighting image. The light source is the same as the original one. Realtime lighting does not participate in baking, but also acts on dynamic and static objects. Mixed light sources are used in baking and only act on non-static objects during real-time running; the Baked light source only applies to light baking and does not participate in real-time light computing.
Observe SceneView again to see the baked color.

On the Lightmaps tab of the Lighting panel, you can also see the baked illumination chart. Why? How can I have two images? I will explain it later.

If you use a pure Static Lightmap for baking, there will be an Indirection Resolution setting, which corresponds to the Realtime Resolution in Precomputed Realtime GI and also controls the impact of indirect light, the results are the same.

Baking Static Lightmap and RealtimeGI at the same time

What will happen if both Static Lightmap and RealtimeGI are baked? First, the light produced by the light source and the secondary reflection between objects will be directly baked on the static light map, therefore, it is useless in this baking mode to adjust the effect of the light source or object material in real time using GI, however, in this mode, the self-emitting material and the radiant light produced by the sky light can still change in real time and overlay the light on the baked color.
Light baking color information

Radiation Level Information

Final synthetic color

In addition to the self-shining red color, there is also a little indigo color in the radiation level information diagram, which is the color produced by the sky box. Adjusting the Ambient Intensity in Environment Lighting can control the effect of the sky box on the overall brightness of the scene. In general, the main color is still the Lightmap control after static baking, But it increases the dynamic sky light and self-illumination in GI. In general, it is not recommended to use this method for scenario rendering. It also consumes the memory required for static Lightmap and GI, and consumes GI computing resources. The effect is not as good as it is.

In my opinion, the biggest benefit of GI is that it allows art to see the effect of the scenario after Lightmap is used in real time. That is to say, first disable Baked GI and only bake some Precomputed Realtime GI, then art can adjust the light source, object material, sky box and other values at will and observe the final effect of the scene in real time, finally, when everything is satisfied, close Precomputed Realtime GI and use Baked GI to bake the lightmap.

Other Lightmap settings)

There is a big pitfall here. I will dig it and fill it out later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.