programming4us
programming4us
MULTIMEDIA

Programming with DirectX : Overview of Lighting - Pros and Cons of Per-Vertex Lighting, Per-Pixel Lighting

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
Lighting in computer graphics involves algorithms that for shading surfaces in a scene to lighten or darken the colors that are rendered based on some set of attributes. Lighting in video game graphics is usually evaluated on a per-vertex or per-pixel level. In the following section we will discuss these two methods in more detail as they relate to lighting.

Pros and Cons of Per-Vertex Lighting

Per-vertex lighting essentially means executing a lighting algorithm on each vertex of a piece of geometry. The resulting colors are usually interpolated across the surface during shading. An example of per-vertex lighting is shown in Figure 1.

Figure 1. An example of an object lit by per-vertex light.


Per-vertex lighting has some good and some bad qualities. From a programming point of view, the complexity of using an algorithm per vertex rather than per pixel is not increased or decreased, thanks mostly to the current nature of shading technology and languages. If anything, per-vertex lighting could be faster than per-pixel lighting if the algorithm executes fewer times in a frame, because fewer vertices are being processed than pixels in per-pixel lighting, not to mention other issues such as fill rate that can affect performance. The downside to using per-vertex lighting includes some of the following.

  • Depending on the object’s topology, the quality of per-vertex lighting can be less than that of per-pixel lighting.

  • Increasing lighting quality using a per-vertex approach usually requires an increase in polygon count, which can lead to performance side effects such as the need for increased and polished results.

  • Per-pixel lighting has various extensions that allow for the simulation of lots of detail without the actual detail being present, while retaining a positive performance and frame rate.

Since the lighting algorithm is evaluated on the per-vertex level, the quality of the rendered surfaces depends on the polygon count of objects. Therefore, theoretically, the closer a polygon is to the size of a pixel, the better the results will be. Making many small polygons to get small details and quality is not often acceptable in video games, however. Increasing the polygon count introduces a host of issues such as increasing geometry bandwidth, increasing the possibility of over-draw many times (i.e., drawing lots of polygons on top of each other unnecessarily), and the dramatic increase of extra data, which can create all types of problems with the application’s performance.

On today’s hardware, simulating detail using a pixel approach is more efficient than using a vertex approach. A case in point can be seen with the normal mapping technique used to simulate high-polygon geometry using low polygon numbers. This is being done in many games such as Gears of War 2.


Take, for example, a wall defined by four vertices. If this wall’s surface takes up a large portion of the rendering canvas, the lack of lighting evaluations will cause the surface to have an unrealistic look, especially when the lights and cameras change orientation in relation to one another. In other words, the change in color for one or two vertices can cause a color shift across large portions of the surface that can occur faster than what looks believable. If the color of one vertex of this wall changes, a huge portion of the wall’s color will instantly change awkwardly.

With more lighting evaluations, the lighting simulation can appear more consistent and accurate (relatively speaking). And since we cannot render anything less than a pixel, what else can be better to use to evaluate lighting than to do it on the per-pixel level?

Per-vertex light is lighting that is performed in a vertex shader or manually on the vertices of objects.


Per-Pixel Lighting

Real-time per-pixel lighting is commonly performed within the pixel shader. By executing the lighting algorithm on the pixel level, the polygon count in terms of lighting quality becomes irrelevant. Of course, polygon count still matters in terms of the curvature and symmetry of the geometry. An example of an object lit by per-pixel lighting is shown in Figure 2.

Figure 2. An example of per-vertex (left) and per-pixel (right) light.

Other  
  •  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
  •  Adobe Flash Professional CS5 : Creating Frame-by-Frame Animation - Editing Keyframes
  •  
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    - Messages forwarded by Outlook rule go nowhere
    - Create and Deploy Windows 7 Image
    - How do I check to see if my exchange 2003 is an open relay? (not using a open relay tester tool online, but on the console)
    - Creating and using an unencrypted cookie in ASP.NET
    - Directories
    - Poor Performance on Sharepoint 2010 Server
    - SBS 2008 ~ The e-mail alias already exists...
    - Public to Private IP - DNS Changes
    - Send Email from Winform application
    - How to create a .mdb file from ms sql server database.......
    programming4us programming4us
    programming4us
     
     
    programming4us