Mobile/diffuse Why the light is weird when used with a point light source

Source: Internet
Author: User

The newly-learned unity3d, many do not understand. If there is a problem with the understanding below, please leave a message to indicate.

Just met such a problem: The scene dragged a box, on a mobile/diffuse material, in the box at the top of a point light, moving point light source, found that the box of light is very strange, moving to both sides of the near bright dark, but moved to the middle position above the box, A shading of the upper surface of the entire box.

See the Mobile/diffuse source notes understand the reason:

fully supports only 1 directional light. Other lights can affect it, but it'll be per-vertex/sh

This shader can only support one parallel light, and the other light sources will calculate the light according to the shader of the vertex.

That is to say, in my scene, the illumination is actually calculated by the vertex (Mobile-vertexlit.shader). When the point light source on both sides of the box (such as the left side), because the distance to the left of the vertex is near, so the light is strong, far from the right vertex, so the light is weak, the middle pixel interpolation, so it seems normal light.

However, when the point light is just above the box, because the distance between the left and right vertices is the same, for example, the light intensity is 0.5 at the top of the line, and 0.5 on the other, so the pixels in the middle of the interpolation will become 0.5, so you will see the entire surface light intensity.

Mobile/diffuse Why the light is weird when used with a point light source

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.