Results 1 to 9 of 9

Thread: Lightmap Question

  1. #1
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    426

    Lightmap Question

    I would like to confirm something about lightmaps. Is it just a black and white and grey texture generated for every polygon in a scene depending on the lighsources, shadows etc?? If so, wouldnt that take up ALOT of memory for that many textures, even though they are only black and white?? Also, wouldnt it take AGES to generate them?? Because in my terrain engine i generate shadows for the verteces and that takes a while, while lightmaps are ALOT more complex than just vertex colours...
    :: Sleep is a poor substitute for caffeine ::

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Posts
    204

    Re: Lightmap Question

    I use color lightmaps. If your code to calculate lighting is written well it shouldn't take to long, define long and how many polys are you talking about?

  3. #3
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Lightmap Question

    most games (eg quake2/3) use coloured lightmaps
    yes they can take a while to generate if your scene is big, if youve got a nice fast + tight scenegraph though (which hopefully u should have) this can decrease compile times IMENSELY

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: Lightmap Question

    Also, lightmaps don't usually have to be sampled at a very high resolution to look good, so you save some memory that way. Besides, if you're lucky a lot of your scene is either completely in shadow or completely in light and can therefore use the same parts of a lightmap.

  5. #5
    Junior Member Newbie
    Join Date
    Nov 2001
    Posts
    15

    Re: Lightmap Question

    Has someone a link to sth about using lightmaps?

  6. #6
    Guest

    Re: Lightmap Question

    Hi...sorry but I've no answer but questions, because I would like to use lightmaps but I think I didn't understand them very well.
    Every time the scene is drawn the processor must calculate for every polygon a new lightmaps in function of the light?
    (sorry for my English)

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Lightmap Question

    No, you use lightmaps only for static light sources, and calculate the lightmap only once. You can, of course, update your lightmap dynamically, but don't expect any good performance for a somewhat detailed scene.

  8. #8
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    426

    Re: Lightmap Question

    Or you can use dynamic lightmaps only for some light sources, like a player carrying a torch or something...
    :: Sleep is a poor substitute for caffeine ::

  9. #9
    Member Contributor
    Join Date
    Jul 2001
    Location
    Czech Republic
    Posts
    78

    Re: Lightmap Question

    Somewhere I have read that it is enough to sample one lightmap texel per one "game" meter, if you understand what I mean (in closed environments, like buildings). I tried some terrain engine and there it was enough even to sample one texel per four or five meters and the results were quite cool. Even with dynamic lights. And performance hit was not that bad. Just few fps.

    greets
    Platinum

Similar Threads

  1. lightmap textures with 3 ch. instead of 1? why?
    By 3Lines_Kova in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-15-2011, 02:49 PM
  2. lightmap
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-28-2004, 03:17 PM
  3. More than one lightmap
    By Leyder Dylan in forum OpenGL: Advanced Coding
    Replies: 18
    Last Post: 10-26-2003, 09:46 AM
  4. Replies: 1
    Last Post: 07-23-2003, 05:30 AM
  5. Lightmap generation
    By RiotGODD in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-02-2001, 04:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean