Ambient Light



Your favourite Japanese volcano is now available in a super cute ambient light form. Mount Fuji is the highest volcano in Japan at 3,776.24m (12,389ft). Bring this miniature mountain into. Ambient light, also known as diffuse environmental light, is light that is present all around the Scene A Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces.

Ambient light means the light that is already present in a scene, before any additional lighting is added. It usually refers to natural light, either outdoors or coming through windows etc. It can also mean artificial lights such as normal room lights.

Ambient light can be the photographer's friend and/or enemy. Clearly ambient light is important in photography and video work, as most shots rely largely or wholly on ambient lighting.

Unfortunately ambient light can be a real nuisance if it conflicts with what the photographer wants to achieve. For example, ambient light may be the wrong color temperature, intensity or direction for the desired effect. In this case the photographer may choose to block out the ambient light completely and replace it with artificial light. Of course this isn't always practical and sometime compromises must be made.

On the other hand, many of history's greatest photographs and film shots have relied on interesting ambient light. Unusual lighting can turn an otherwise ordinary shot into something very powerful.

-->

Ambient lighting provides constant lighting for a scene. It lights all object vertices the same because it is not dependent on any other lighting factors such as vertex normals, light direction, light position, range, or attenuation. Ambient lighting is constant in all directions and it colors all pixels of an object the same. It is fast to calculate but leaves objects looking flat and unrealistic.

Ambient lighting is the fastest type of lighting but it produces the least realistic results. Direct3D contains a single global ambient light property that you can use without creating any light. Alternatively, you can set any light object to provide ambient lighting.

The ambient lighting for a scene is described by the following equation.

Ambient Lighting = Cₐ*[Gₐ + sum(Atteni*Spoti*Lai)]

Where:

ParameterDefault valueTypeDescription
Cₐ(0,0,0,0)D3DCOLORVALUEMaterial ambient color
Gₐ(0,0,0,0)D3DCOLORVALUEGlobal ambient color
Atteni(0,0,0,0)D3DCOLORVALUELight attenuation of the ith light. See Attenuation and spotlight factor.
Spoti(0,0,0,0)D3DVECTORSpotlight factor of the ith light. See Attenuation and spotlight factor.
sumN/AN/ASum of the ambient light
Lai(0,0,0,0)D3DVECTORLight ambient color of the ith light

The value for Cₐ is either:

  • vertex color1, if AMBIENTMATERIALSOURCE = D3DMCS_COLOR1, and the first vertex color is supplied in the vertex declaration.
  • vertex color2, if AMBIENTMATERIALSOURCE = D3DMCS_COLOR2, and the second vertex color is supplied in vertex declaration.
  • material ambient color.

Note If either AMBIENTMATERIALSOURCE option is used, and the vertex color is not provided, then the material ambient color is used.

To use the material ambient color, use SetMaterial as shown in the example code below.

Gₐ is the global ambient color. It is set using SetRenderState(D3DRS_AMBIENT). There is one global ambient color in a Direct3D scene. This parameter is not associated with a Direct3D light object.

Lai is the ambient color of the ith light in the scene. Each Direct3D light has a set of properties, one of which is the ambient color. The term, sum(Lai) is a sum of all the ambient colors in the scene.

Example

In this example, the object is colored using the scene ambient light and a material ambient color.

Ambient Lighting Kits For Cars

Ambient

According to the equation, the resulting color for the object vertices is a combination of the material color and the light color.

The following two illustrations show the material color, which is gray, and the light color, which is bright red.

The resulting scene is shown in the following illustration. The only object in the scene is a sphere. Ambient light lights all object vertices with the same color. It is not dependent on the vertex normal or the light direction. As a result, the sphere looks like a 2D circle because there is no difference in shading around the surface of the object.

Ambient Light Cars

To give objects a more realistic look, apply diffuse or specular lighting in addition to ambient lighting.

Ambient Lighting For Cars

Related topics