GLLT.EXE: SAMPLE: Demonstrates Simple Lighting in OpenGL

Last reviewed: June 6, 1996
Article ID: Q152001
The information in this article applies to:
  • Microsoft Win32 Software Development Kit for: - Microsoft Windows NT version 3.51 - Microsoft Windows NT version 4.0 (beta) - Microsoft Windows 95 version 4.0

SUMMARY

The GLLight sample provides a demonstration of how the various light settings effect an OpenGL scene. The initial scene is simply a single white sphere with a single blue light (GL_LIGHT0) shining on it.

You can modify all of the properties of that light as well as the light model characteristics for the scene to observe the visual effect. GLLight does not use multiple lights and does not allow you to change the material properties of the sphere.

The GLLight sample is included in GLLT.EXE, a self-extracting file, which can be found on these services:

  • Microsoft's World Wide Web site on the Internet

          On the www.microsoft.com home page, click the Support icon
          Click Knowledge Base, and select the product
          Enter kbfile GLLT.EXE, and click GO!
          Open the article, and click the button to download the file
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder
          Get GLLT.EXE
    
  • The Microsoft Network

          On the Edit menu, click Go To, and then click Other Location
          Type "mssupport" (without the quotation marks)
          Double-click the MS Software Library icon
          Find the appropriate product area
          Locate and download GLLT.EXE
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download GLLT.EXE
    

For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

MORE INFORMATION

GLLight allows you to experiment with all of the OpenGL lighting capabilities for a single-light scene quickly and easily. These characteristics fall into the following categories seen in the "Settings" dialog box:

   Characteristics of the Light Source (GL_LIGHT0):
     Position
     Intensity (ambient, diffuse, specular)
     Spotlight Properties (exponent, cutoff)
     Attenuation (constant, linear, quadratic)

   Characteristics of the Lighting Model:
     Global ambient light
     Viewpoint (local or infinite)
     Lighting (one-sided or two-sided)

The initial settings for these characteristics follow the defaults for GL_LIGHT0 with two exceptions: the Position is moved back so as to light the sphere; and the Diffuse Intensity is set to blue.

The material properties of the sphere are left as defaults except for a white Specular reflectance and a medium Shininess setting. You cannot modify the material properties through the UI in this sample.

To demonstrate the effects of one-sided vs. two-sided lighting, there is an option to place a clipping plane through the sphere in order to uncover the inside of it. To see the difference between the inside and outside more clearly, you should move the light some distance along the x or y axes.

REFERENCES

For more information on the above settings and OpenGL in general, please read:

-Neider, Jackie, Tom Davis, and Mason Woo. OpenGL Programming Guide: The Official Guide to Learning OpenGL, Release 1. Reading, MA: Addison-Wesley, 1993. ISBN 0-201-63274-8. (This book is also known as the "Red Book".)

For information on Material Properties in OpenGL, please see: The GLBMP Sample "Demonstration of OpenGL Material Property and Printing" in the Microsoft Software Library, and the "Red Book" mentioned above.


Additional reference words: 3.51 4.00 gllt.exe opengl
KBCategory: kbgraphic kbfile
KBSubcategory: GdiOpenGL



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 6, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.