About Lighting in Unity (vii)

Source: Internet
Author: User

Global Illumination GI

The reflection here is that a red object, when the sun shines on it, the objects around it will become a little red.

1:realtime every frame will calculate the light, real-time illumination is not reflected, so its light and shadow appear monotonous;
2:baked GI: By baking light map to obtain a good lighting effect, can not change the light in real time;
3: Pre-computed global illumination: precumputed Realtime GI
Real-time illumination does not show the effect of indirect illumination, such as real-time illumination on a red object.
The reflection of the red object, if there is no reflection in real time, if the use of pre-illumination, then the static object will be pre-calculated reflection, so that the object shows indirect light effect;
4: Ambient Light

Pre-global illumination ideas

1: Use real-time lighting, write the scene;
2: Turn on the pre-illumination option Window--->lighting-->scene panel-->precomputed Realtime GI;
Realtime resolution represents indirect illumination resolution, the higher the value the more obvious the indirect illumination effect, the indirect light is the sun shines on the object, the object reflects the sun light is indirect light.
3: Run the scene, see the light source angle changes, the scene of the lighting effect is also real-time;
4: Through the pre-illumination, effectively reduce the original in-game real-time calculation of the number of global lighting, if the user needs to change the light source in the game color, light source direction, light intensity, the general use of pre-lighting;
5: Pre-illumination is also for static objects, and no pre-illumination is calculated for dynamic objects;
6: Real-time illumination + pre-illumination to the static object to generate reflection effect;

Global Illumination GI Instance

1. Create a Unity project and file directory

2. Remove ambient light window---->lighting---->skybox set to None

3. Create a flat plane and a cube cube to build a static scene, create a materials folder, and create a red material ball

Figure

4. The cube cube associated with the red material ball, when the light shines down, found that the floor plane only hate blunt shadow.

Figure

5. Create a script that controls the rotation of the solar light around the y-axis of the world's coordinates, causing the illumination to change, and the script is called rotate_lighgt and mounted under the light node of directional

Open ROTATE_LIGHGT:

usingUnityengine;usingSystem.Collections; Public classRotate_light:monobehaviour {//Use this for initialization    voidStart () {}//Update is called once per frame    voidUpdate () { This. Transform. Rotate (Vector3.up, Time.deltatime * -, Space.world);//rotation around the world's Y axis, 1 seconds to 50 degrees, space.world to rotate it around the y axis of the world coordinate system, without writing it rotates around its own coordinate system Y axis Obviously, Time.deltatime is counted by every second.    The refresh of Update () is displayed per frame, but time.deltatime is counted in seconds. } //I understand that we only set it here for 1 seconds, that is, 1 time.deltatime rpm Degrees, the system will help us calculate how many degrees each frame is (except for 60), and then turn it to its own calculated angle each time it is update.}

6. Mark both cube and plane as static, open the pre-illumination window---->lighting---->scene---->precomputed Realtime GI, with reflected light, more realistic than before

Figure

Light Summary

1. Real-time lighting: Simulate real-life lighting in the object, divided into point lights, spotlights, sunlight

These light features such as: Draw halo halo, flare flare

Features: Can not participate in reflection, direct lighting and shadow, high performance overhead

2.baked Illumination Map: The light source is configured as baked mode, the objects are configured as static, baking out the entire light map

Features: Good results and performance, but can no longer change

Two questions: 1. What to do when a dynamic object enters the scene----> Light probe, dynamic object collection of light probe information, and finally the light probe information on the dynamic object, so the dynamic object can be well integrated into the static baked light scene

2. No reflection, want to do reflection how to do----> reflective probe, in the scene to decorate a reflection probe point, after the layout, will be the surrounding object projection to the dynamic material above, an object (plane) and then affixed to the dynamic material display, so that can show the reflection

Technology: Self-luminous material, want the model to be finer without increasing the model vertex----> Normal map (normal map), light matte (occulsion), level two texture map secondary maps.

Self-shader mode: Mobile diffuse,standard,lagacy Shaders---->bumped diffuse (both with base diffuse map and add line map)

About Lighting in Unity (vii)

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.