Summary of common illumination models and surface rendering Algorithms

Source: Internet
Author: User
Document directory
  • Basic Ray Tracing Algorithm

Basic Illumination Model

Diffuse Reflection Model (Lambert Model)

Ambient Light: iambdiff = KD * IA. Ia indicates the ambient light intensity, and KD (0 <KD <1) indicates the inverse effect of the material on ambient light.

Radiation coefficient. iambdiff is the light intensity of the Interaction reflection between the diffuse reflection body and the ambient light.

Direction light: ildiff = KD * Il * Cos (θ), where Il is the incident angle, and ildiff is the interaction reflection between the diffuse reflection body and the direction light.

. Cos (θ) is equivalent to (point multiplication), where it is the unit method vector of vertex, which is the vertex

Vector of units to the light source.

Finally, the combination of ambient light and direction light can be written into the lambert model:

Idiff = iambdiff + ildiff = KD * Ia + KD
* Il *

Mirror reflection model (Phong Model)

The phong model considers that the intensity of the mirror reflection is related to the angle between the reflected light and the line of sight:

Ispec = KS * Il *

KS indicates the mirror reflection coefficient, and NS indicates the highlight index,VThe unit vector from the vertex to the viewpoint,RThe unit vector of the reflected light direction.RAccessible andLFind,

R= 2-L

The final model is:

Ispec =

Corrected the mirror light model (BlinN-phong illumination model)

BlinN-Phong is a Phong-based model correction model. Its formula is as follows:

Ispec = KS * Il *

WhereNIs the unit method vector of the incident point,HIs the light Incident DirectionLAnd viewpoint directionVTHE INTERMEDIATE VECTOR

It is also called the halfwidth vector (the halfwidth vector is widely used in various illumination models, not only because of the halfwidth Vector

The information value also lies in that the halfwidth vector is a simple computing:H= (L+V)/|L+V|.

Combination of diffuse reflection and mirror reflection

For a single point light source:

I = idiff + ispec = KD * Ia + KD * Il *
+KS * Il *

For multiple point light sources:

I = KD * Ia +

Light Tracing

Basic Ray Tracing Algorithm

Because there are infinite lines of light emitted from the light source, it is very difficult to track the light directly from the light source. In fact, only a few rays from a light source pass through the reflection and transmission (refraction) of the scene to the eyes of the observer. Therefore, the standard light tracing algorithm uses reverse tracking technology to draw the entire scenario.

Light tracing: Starting from the viewpoint, each pixel center on the image plane emits a line of light to the scene. The light starts from the viewpoint, and the direction is the pixel center and the unit vector of the viewpoint line. There are three possibilities for the intersection of light and the scene object surface closest to the viewpoint:

1. The surface of the object where the current intersection is located is an ideal diffuse area, and the tracking ends.

2. The surface of the object where the current intersection is located is an ideal mirror, and the light continues tracking along the mirror emission direction.

3. The surface of the object where the current intersection is located is a regular transmission plane, and the light continues tracking along the regular transmission direction.

Add the intersection surface to a binary ray tracing tree one by one based on the above ideas.

Radiant Illumination Model

Basic radiation level model:

BK = EK = ek

Among them, it is the shape factor of surface J and K, which is the ratio of radiant energy of surface J reaching surface K to radiant energy of exit surface J. HK is the total radiant energy of all surfaces in the closure that reaches the surface K on the unit area. BK is the total rate of radiant energy that leaves the surface K in an area.

Methods for Improving the radiation level:

The pseudocode is as follows:

For each patch K

Foreach patch J

{

Drad = rock [J] * B [k] * f [J] [k] * A [J]/A [k];

DB [J] = DB [J] + drad;

B [J] = B [J] + drad;

}

DB [k] = 0;

Shading

Gouraud shading: Draws the intensity interpolation surface. The polygon surface is drawn by linear interpolation of the light intensity on the surface of the illumination object. During use, the following computation is required:

1. determine the average unit normal vector at the vertices of each polygon

2. Calculate the light intensity of each vertex Based on the illumination model.

3. linear interpolation of vertex strength in polygon projection area

Phong Shading: It is also called method vector interpolation. Unlike the Gouraud method, the method vector interpolation replaces the intensity interpolation. The results are more accurate and the highlights are more realistic, but more calculations are needed.

1. determine the average unit normal vector at the vertices of each polygon

2. linear interpolation of the vertex normal vector in the polygon projection area

3. Calculate the light intensity of the projected pixel along each scanned line using the interpolation method Vector Based on the illumination model.

 

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.