Home Technical Talk

Half life 2 lightmap usage?

polycount sponsor
Offline / Send Message
malcolm polycount sponsor
Anyone know on average what the texture budget is for a half life 2 level for just the lightmaps? Also are the lightmaps compressed in any way?

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    AFAIK, no lightmaps. See the PDF. The "radiosity normalmapping" is lit per-vertex, if I'm understanding it correctly.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    They definately use lightmaps, it states it in that document.
  • Campaignjunkie
    Options
    Offline / Send Message
    Campaignjunkie polycounter lvl 18
    I'm not sure what you mean exactly, so I'll just spit out some information:

    Lightmaps are compiled into the BSP map file automatically using a radiosity simulator - hence, there's not really a budget, although the lightmap scale CAN be adjusted on world geometry on a per-face basis for better performance or finer details. The only problem people should have with a lightmap budget is when the map is really big and open, or when you're using a small lightmap scale to get detailed shadows.

    Since I think you're talking about models - static prop models aren't light-mapped; they're lit based on the lightmap information at their origin. However, dynamic models, such as vehicles or NPCs, are vertex-lit.
  • Eric Chadwick
    Options
    Offline / Send Message
    Cool, thanks for this. So the level lightmaps are actually rendered into bitmaps? I thought Mr. McTaggart was saying they store it all in vertex shaders. But I'm in the dark, so I'm probably wrong.
  • Campaignjunkie
    Options
    Offline / Send Message
    Campaignjunkie polycounter lvl 18
    I'm no engineer, but that's how I understood it at least. My programmer friend says it's "raw RGB data in the BSP, most likely split up into a few big textures, with surfaces referencing portions of them, to save on texture memory swapping, similar to Q1/Q2/Q3/HL1." Which makes sense, I suppose.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    My question was not about props, I want to know on average how many megabytes of texture ram do the lightmaps use in a map. I don't care that they are compiled into bsp I'm curious about how much space they take if you were to extract them from the bsp. Surely you can't just tag every face in the environment with a 2048x2048 lightmap and say done. There are always budgets you have to follow so the video card does not choke.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Eric the radiousity just means they use some form of bounce lighting to achieve a global illumination effect. Light rays can bounce around a set number of times before they die.
  • Campaignjunkie
    Options
    Offline / Send Message
    Campaignjunkie polycounter lvl 18
    d3c170700015ru.th.jpg

    Start HL2 with parameters -console and -dev, load a map, and then execute the console command "+showbudget_texture_global" - a graph will pop onto your screen. Just repeat with a variety of maps and I'm sure you could calculate some sort of average. (see screenshot above, bottom-left)

    I'm sorry I can't give you a straight answer, but it just rarely matters since the default lightmap scale (16 luxels per unit) is usually good enough. I'm sure if you e-mailed Valve they could give you more information, but this is simply a question that's rarely asked. smile.gif
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    perfect I'll give this a try thanks!
Sign In or Register to comment.