Thread: lightmaps vs "regular" lighting

  1. #1
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071

    lightmaps vs "regular" lighting

    Iv'e gone back to working on the lighting for my engine, and I was wondering if it would be better to use lightmaps rather than 'regular' lighting calculation? Its my thinking lightmaps would be faster, but i'm not really sure. Any thoughts?

    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Lightmaps are ideal for static lighting. You're going to want to use a different approach for the dynamic lights in your level.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  3. #3
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    The PC engines lately have been trying to do a lot of fancy things using light maps along with hardware lights. For the best results, you're should try taking a bit form column A and a bit from column B. One of the sessions I attended at GDC a few months ago discussed performing lighting calcuations on the textures/maps instead of lighting the geometry. I forget who exactly talked about that, but the 3 speakers were Naty Hoffman, Peter-Pike Sloan, and Dan Baker. A google of those names should bring you a lot of crap, plus a few links to their research.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Hardware lights are expensive and they get even more expensive when you are using more than 1 light per scene. Lightmaps are an extremely good way to fool the player into thinking there are several light sources in the room. Not to mention that if you do the lightmap correctly it turns out to look pixel perfect.

    Another alternative is to use pixel shaders and vertex shaders. The vertex shaders basically transform the vertex and the pixel shaders are what is responsible for shading the resulting triangles.

    Lightmaps when used correctly will produce a very good static lighting engine. For dynamic lighting you would prob want to forego the default per-vertex lighting scheme of DirectX/OpenGL and use vertex/pixel shaders or Cg.

  5. #5
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    Ok, thanks for the info. I think I know where to go from there. But I still have one question.
    If I use lightmaps, will that effect normal mapping/per-pixel lighting, if for example they are both used together on one piece of geometry? Or dosn't it matter?

    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lighting woes.
    By psychopath in forum Game Programming
    Replies: 3
    Last Post: 08-19-2006, 08:26 PM
  2. Eliminating lighting "over-bright"
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 05-31-2006, 06:52 PM
  3. GLSL lighting (again)
    By psychopath in forum Game Programming
    Replies: 6
    Last Post: 12-19-2005, 01:34 PM
  4. Replies: 6
    Last Post: 11-12-2005, 11:57 AM
  5. Lighting a Direct3D 9 mesh sphere
    By bennyandthejets in forum Game Programming
    Replies: 12
    Last Post: 02-14-2005, 01:19 AM