MULTIMEDIA

Programming with DirectX : Light Types - Directional Lights,Point Lights,Spot Lights, Area Lights

1/21/2014 12:54:28 AM

In computer graphics, different types of lights can be rendered, with each type altering the lighting algorithm to create a specific type of effect. In this section we will briefly discuss the following light types.

  • Directional

  • Point

  • Spot

  • Area

Directional Lights

A directional light in computer graphics appears to come from a direction but has no specific point of origin. Directional lights are the types of lights used to simulate light coming from far away.

Point Lights

A point light emits from a point in space, where the light decreases in intensity over distance. This type of light can be a light bulb, candle, light from a TV screen, and so forth. In computer graphics, a point light usually emits light equally across a radius in all directions, while a directional light emits light in a specific direction with no fall-off in intensity with distance.

Light decreasing over distance is known as light attenuation, and it is the property of a point light that creates the point light affect. In other words, if you take a directional light and apply attenuation, you can create the point light effect.

Spot Lights

A spot light is essentially a point light that is restricted to a direction, often in the shape of a cone, instead of shining in all directions. In real life we use objects to block light’s ability to shine in certain directions. In computer graphics various mathematical equations can be used to simulate the spot light effect.

Area Lights

An area light in computer graphics is an array of lights that collectively cover an area. Areas lights are commonly used to produce soft shadows in a scene by allowing the various surfaces of a scene to be sampled not only by more than one light but also by slightly varying the positions of these lights. This causes the surfaces to be rendered in a way that softens sharp shadows since the lighting contribution for the discreet points throughout an area light source affect those dark areas. In other words, the shadows themselves receive light that gradually lightens them up, giving a soft shadow appearance.

Therefore, if you use a large array of many point lights, the shadows in the scene will receive light from some of the area light points more than others, creating the softening effect. This occurs because single light sources shade pixels so that those pixels are either in light or in shadow, which creates hard shadows. By creating an area of lights and by accumulating the results, the “in shadow” or “in light” question becomes what percentage is in light versus in shadow, which creates the varying shades of gray necessary for soft shadows.

In real life, light bounces around the environment so many times that shadows are soft because the shadows are not actually the result of no light at all, but instead are the result of some surfaces not being lit as much as others. Light bouncing around the scene falls under the topic of global illumination, which is a highly advanced computer graphics topic. Area lights do not bounce off of surfaces and therefore are not considered global illumination. Area lights, basically, are just a lot of lights covering an area.

Area lights are used more in ray-traced scenes than in video game scenes since the number of light sources in an area light necessary to create believable soft shadows can be far more expensive than what is reasonable for a game’s real-time requirements. Lighting can become expensive, and area lights can be very costly.

Other  
  •  Programming with DirectX : Overview of Lighting - Pros and Cons of Per-Vertex Lighting, Per-Pixel Lighting
  •  What Will 2014 Bring To Tech Lovers?
  •  DirectX 10 Game Programming : Direct3D - Textures and Details (part 3) - Drawing the Textured Object
  •  DirectX 10 Game Programming : Direct3D - Textures and Details (part 1) - Adding Support for Texture Mapping - Texturing Coordinates and Sampling
  •  DirectX 10 Game Programming : Direct3D - Textures and Details (part 1) - Adding Support for Texture Mapping - The Vertex Format
  •  DirectX 10 Game Programming : Shaders and Effects - Geometry Shaders
  •  Adobe Photoshop CS5 : Managing Color from Monitor to Print - Working with Rendering Intents
  •  Adobe Photoshop CS5 : Managing Color from Monitor to Print - Changing from Additive (RGB) to Subtractive (CMYK) Color
  •  Adobe Photoshop CS5 : Managing Color from Monitor to Print - Setting Up Soft-Proof Colors
  •  Adobe Photoshop CS5 : Managing Color from Monitor to Print - Producing Consistent Color
  •  
    Top 10
    Review : Sigma 24mm f/1.4 DG HSM Art
    Review : Canon EF11-24mm f/4L USM
    Review : Creative Sound Blaster Roar 2
    Review : Philips Fidelio M2L
    Review : Alienware 17 - Dell's Alienware laptops
    Review Smartwatch : Wellograph
    Review : Xiaomi Redmi 2
    Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
    Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8