Advanced lighting and materials to simulate real-world illumination

Source: Internet
Author: User

The second chapter of reading notes adds to the understanding and complement of many bloggers.
The second chapter is also the basic knowledge, supplemented the BO master many knowledge gaps.
This paper introduces four types of light illumination models, point light source, surface light source, directional light, Spotlight, and their illumination model, and also briefly introduces the lower GI.

Several topics of this chapter:
1. Ideal Spot Light
2. Geometric attenuation
3. Attenuation of light through matter
4. Directional light
5. Area Light
6. Spotlight
7. Local and global illumination models
8. Ambient light
The author first introduces some examples of light in the real world, with a variety of shape colors and sizes. Real-time rendering needs to be calculated every frame so pay attention to tradeoff consumption, and offline rendering can slowly render computationally complex high-quality GI.
The reason why light appears to be true is the reflection of light attenuation, so the calculation of light attenuation is one of the main purposes of calculating illumination.

The ideal point light source


In the virtual world we can only simulate the ideal point light source, point light source is also the prototype of all kinds of light source, its characteristics apply to all kinds of light source, hmm, the point light source is the ancestor, all light sources are from the point light source variant.
A point light is the energy of a sphere that is emitted at a point in a radius, but the point light in the real world does not have a range, but in order to save the calculation, we can customize the range to avoid the small negligible light intensity.

Here is a definition: the ball is divided by the three-dimensional angle, the spherical degree is the unit of three-dimensional angle, 4π spherical degree is the whole ball.

The point light source is the luminous flux luminous flux measured in lumen lumen to measure radiated power. Each time the energy is called flux flux, and then this light energy makes it luminou. It is convenient to call luminous intensity light intensity as the energy per unit of stereoscopic angle emission. For visible light, the intensity of the light measured per unit is called the Candela (in this unit).
Power Power is the energy that is measured per unit of time. Light intensity is derived from power. The two units of energy and power are not interchangeable. Some light units, such as Candela,lumen,candlepower,nit, and so on, require unit transformations for the conversion between them.
Then speaking of geometric attenuation, the intensity of light is inversely proportional to the square of the distance to the surface of the illuminated object, and the attenuation is in direct proportion to the square of the distance.
Attenuation is due to the distance and light through the material of the energy transfer generated, this energy transfer and light through the fog and turbid water by the small particles in the particle absorption, scattering, which means that the absorption of fog, scattering effect is independent of light attenuation, attenuation is constant. Also note that the light attenuation will not be reduced to 0, because even if you divide by infinity distance squared He is only approaching 0 but not 0, which is the reason why the point light of the real world is not range.


There is no perfect point of light in nature, but the next light source is closer to the real world.
The lighting formula for a point light source, for example, is basically a change caused by attenuation.

Directional light


The most common direction is sunlight. Just talked about the light source when said, all types of light source is caused by the deformation of the point light source, then the direction of light is how to become the point?
Case 1: The directional light is infinitely far from the point light source, the angle difference is too small can be negligible
Case 2: The size of the point light is greater than or equal to the illuminated object
A picture all explained

Or the Sun's example, the sun is farther than 108,000 miles from the earth, well, it's actually 150000000km,
The sun and the Earth at both ends of the angle of less than 0.005 degrees, of course, can be ignored. Others say, what about attenuation? When we can calculate attenuation, the other half of the earth is dark, there is no light ... This is a point, and more importantly, for the distant light distance, the Earth's diameter of this small thickness of the attenuation caused by the difference is also small to negligible.

This is why the homogeneous vector _worldspacelightpos0 of the light in unity, the XYZ component for the point light is the position, the direction is the direction, and Z is the homogeneous part, we know, for the second part of the general situation is 1, if 0, Representing Infinity is the direction, which is why the z part of the directional light is 0 and the z part of the point light is 1.

The formula for directional light is very small, basically a constant, such as

Surface Light


A surface light is the most complex light model, which is used in unity and cannot be calculated in real time, and can be derived from the spotlight spotlight.
So how does the light source change from the point light source? A polygon light can be understood as a set of point lights for a matrix, such as
Each point light is computed over and over again, of course, but this is also why the surface light source looks very real.

You can use soft shadow and softer attenuation techniques to simulate the effect of a polygon light.
The energy of reaching the illuminated object is related to its distance from the surface light source and the angle between them.
The calculation of the attenuation of the surface light source is also different from the point light source, not just the simple inverse of the square,
The complexity of calculating attenuation for polygon light sources of different sizes and shapes is also different, and is commonly calculated as follows:

A is the rate at which light attenuation is affected by distance squared, B determines the linear behavior of attenuation, and C is the coefficient of deviation

Spotlight Spotlight


The spotlight is the extension of the surface light, which has both the nature of the directional light and the nature of the area light, which shows soft illumination (shadows) through the shadow of the Umbra Umbra and Penumbra penumbra.

The spotlight can be imagined as a cylinder shining on the point light source, blocking part of the light, according to the cylinder opening range of different blocking range different exposure light size is different.

The relationship of the Umbra and penumbra to the cylinder and the cylinder opening range and the position of the point light source in the cylinder determines that the tact opening size does not change the size of the penumbra, since the point light source is essentially unchanged, and the size of the penumbra is related to the position of the light source within the cylinder and the light source

To define a spotlight model, we need several parameters, the direction of the spotlight, the umbra direction, the penumbra direction,

When the point is within the Umbra range, the light intensity is 1, if the light intensity is 0 outside the penumbra range. If the angle between the umbra to the penumbra is calculated according to the following formula, F is the attenuation factor, a variety of cosine, calculation is not quite complex, quite consumed.

Global illumination and local illumination and ambient light
Here is a brief introduction to the back of the light tracing to do the groundwork.
In the real world, objects are illuminated not only by light sources, but also by reflections from other objects. Local illumination appears to be very false, without even shading.
However, if we calculate the reflected light of each object as a light source (such as ray tracing) is very expensive and very slow, not suitable for real-time rendering, so we use ambient light to do approximation, so that there is no light in the place without a little brightness.
Environmental light consumption is very low.


Recent update Next Chapter

Blogger's recent renderings:

2016 of rendering

2015 rendering for the second half of the paragraph


----by wolf96 http://blog.csdn.net/wolf96

Advanced lighting and materials to simulate real-world illumination

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.