Shadow settings in Unity 3D

Source: Internet
Author: User

In unity 3D, light shadows are often used, that is, shadow of directional light. Shadow is divided into hard shadow and soft shadow. The difference is that the shadow edge of soft shadow is relatively smooth and close to the truth, but the performance consumption is greater than hard shadow.

Lightmapping has three options: realtimeonly, bakedonly, and auto ).

Realtimeonly: the illumination of all scene objects is calculated in real time, and real-time illumination consumes a lot of performance;

Bakedonly: only display the lighting effect of the baked scene (if there is a place that has not been baked, it will not display the light effect): You can select some static objects for baking in the scenario, static objects here refer to objects that won't be moved during the game (you need to hook up static objects in the Inspector Panel of the object). Therefore, you can do a good job of illumination before running the game, generate a light map, and then display the light map directly when the game is running. You do not need to calculate the light effect in real time and use space (the storage space of the texture) in exchange for time (computing time of real-time illumination ).

Auto: This is the combination of the above two. If this mode is selected, the baked part will be directly displayed using the lightmap, and the part that has not been baked will be calculated in real time.

However, when using shadow, you may encounter a problem: the shadow was originally displayed properly, and the shadow suddenly did not display. The Shadow still has no effect. Hard shadow and soft shadow cannot be used in shadow. the realtime only, bake only, and auto cannot be used in shadow. Why?

The following three situations may cause this phenomenon. If you encounter this problem, try it.

Case 1: The distance is too long to see the shadow. Try to put the camera lens closer. This usually happens when realtimeonly is selected. If not, check the second case.

Case 2: Open edit à Project Settings à quality and view it on the inspect panel, as shown in. In levels, the green mode will be selected during release. The current mode is good. You can view the display in levels in unity in real time. In good levels, unity customizes the Display Effect in the good condition. Below the graph, you can select rendering, shadows, and other. If fast is selected, shadows does not display shadows by default. Therefore, if the shadow is not displayed, check the place. However, this situation usually occurs in real-time shadow.

 

Case 3: The PC platform is switched to the Android platform. In this case, real-time shadow or baking may not be able to display the shadow on the Android platform. The solution is to remove (for example) the check mark after use direct3d 11 in player settings when switching from the PC platform to the Android platform, and then switch to the Android platform, then, the shadow effect is displayed.

OK. Currently, there are three cases. If there are other cases, please write them out in the message and share them together.

Shadow settings in Unity 3D

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.