Sh lighting Analysis

Source: Internet
Author: User
I have read several papers about sh lighting and the source. Comrades who have read the demo will be attracted by such good results, at least for an instant. Softshadow, interreflection, the most bt is that everything is realtime ......

[Add textures at home]

Comrades who have run the demo will surely be impressed with the super-horrible precompute before running. This is just a movie-level computing. So why can we put a lot of computing into precompute, how efficient is realtime?

The first thing I have to mention is that some knowledge about signal processing is superficial. In the process of signal processing, we often use a series of basic functions to process the original signal. All signals correspond to a function to calculate a system value, and N functions finally obtain N values, the N values (N is much smaller than the number of Signals) can roughly restore the original signal back. The larger the N value, the more accurate the restoration.

The actual illumination needs to take all the vertices in all directions into account, which includes all the situations such as self shadow and interreflection, but this is obviously impossible for realtime, however, we can use the previously mentioned signal processing to convert all directions into just n coefficients, which roughly express information in all directions and can be used for realtime, at that time, only a small amount of multiplication and addition are required for each vertex.

It is troublesome to calculate the N coefficients. For each vertex, it is necessary to calculate all directions. So what is all directions? We can randomly find m sampling points, assuming 10000 points, these 10000 points are randomly distributed on the unit sphere, so they can represent all directions. For each direction, when we calculate the vertex in this direction, we first use the rays in this direction to calculate the intersection with the whole mesh. If it is blocked, the light source in this direction will not be able to reach this vertex, but the plane of the intersection can be interreflection with it (discussed later), so this round has no contribution to all coefficients in this direction. After the first pass is over, we will calculate interreflection. You can determine the number of passes you need. The attenuation of each round can be based on the vertex attributes. Each pass degrades the previous pass. For each direction, find the triangle with the nearest intersection, and obtain the coefficient of the pass before the focus point by interpolation, perform attenuation, and then add it to the coefficient of this round. This is interreflection.

Light Source: the light source is also n coefficients. When realtime is used, it is multiplied by the coefficient of the vertex and then added. The coefficient of the light source can be converted to object space, I plan to use diffuse cube map to try it. Unfortunately, the downloaded source has not been compiled successfully. The evil C ++ template ......

PRT should be similar to this. Their critical weakness is... All objects are connected to the Environment mesh and cannot be moved. Dao's demo shows that everyone is drooling. If you have time, I don't know what year it was ......

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.