About Lighting in Unity (iv)

Source: Internet
Author: User

Render path and color space

1:unity shadow effect can be set by setting the rendering path and color space;
2: Render Path: Light to the surface of the object, when the object is colored, the color of the light when there are so several ways of shading, the way to calculate coloring
Forward: shading according to the corresponding influence of light, each light source color once, multiple light sources will be colored multiple times;
Advantages: Fast, low hardware requirements, fast processing transparency; Disadvantage: Each light source must have the corresponding cost, a large number of light sources but lower;
Deferred: Delay the rendering path, the color of the light to the geometric buffer, generate a screen space map, a large number of Realttime light source mode when more realistic, requires high level of hardware requirements;
Legacy Vertex lit: vertex illumination, all lighting will only be calculated on vertices, fast, broadest hardware support.
But does not support shadows, normal maps, light masks, high-precision highlights and so on;
Legacy defferred: Similar to defferfed, but is not the same algorithm;
Edit-->projectsetting player-->inspector-->other Setting-->rendering--> Rendering Path;
3: Color space: Color space determines which algorithm is used to calculate the color mix when lighting or material loads;
Linear color Space
Camma Color Space
Edit-->projectsetting player-->inspector-->other Setting-->rendering--> ColorSpace

Cookies

Use a texture with a channel to act on top of the light, and when the light hits it will be filtered according to the channel. The white part of the cookie texture is allowed through the light, and the black part indicates that the pass is not allowed. Commonly used in window projection.

Example Ideas

1: Set the imported textures, select cookies on the Texture properties panel
Configure the type of light source that the cookie corresponds to;
The Alpha from grayscale option can be checked;
2: In a parallel light source, simply drag a texture or grayscale image with a transparent channel onto the cookie on the light source;

Steps

1. Create a Unity project and file directory to save the scene

2. Copy the cookie texture map to the Res folder, modify the texture type texture to a cookie, and then set the light type source, such as the sun light directional, that corresponds to the light you want to receive.

Alpha from grayscal indicates channel inversion

The Cookie size indicates the number of texture tiles, the larger the spread of the less

Finally click Apply

3. Create a flat plane

4. Drag the cookies texture map into the cookie properties under the light component of the directional light.

5. There are a lot of shadows when the light hits the plane, and the shadows are affected by the cookie texture.

Lens flare

About lighting in Unity (iv)

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.