From Valve Developer Community
Jump to: navigation, search

Lightmap console commands

Any command to view the lightmap in game, similar to Q3As r_drawlightmap x maybe? --Hipshot 22:03, 21 Jan 2006 (PST)

Lightmap commands:—ts2do 22:25, 21 Jan 2006 (PST)

Thanks alot --Hipshot 22:26, 21 Jan 2006 (PST)
For future readers, didn't seem to show the lightmap at all, no one of them. --Hipshot 00:34, 22 Jan 2006 (PST)
Do you mean to just draw the lightmaps, and not any other texture pass, or do you just want an overlay showing the luxels? If you just want overlays of the luxels, use "mat_luxels 1", IIRC. You could probably disable all the other texture passes if you just want the lightmaps getting rendered and not the diffuse/normal/specular etc... Not sure how it would come out looking though. --ReNo 02:47, 10 Jan 2007 (PST)

Does lightmap increase polycount?

I always wondered if yes or no, reducing the lightmap size increases the polycount. One day, I made a test on a small testmap, and this is what came out :

I'm wondering if it was just a particular case, or if it always do that. Because people never talk about this side effect of reducing the lightmap resolution. If that shouldn't do that, I believe we could use a default lightmap of 8 or even 4 instead of 16, couldn't we? (I don't care about the bsp size) --NykO18 02:20, 1 Sep 2008 (PDT)

I'd never noticed that. Perhaps there's a maximum number of luxels per-poly? I count 32 luxels between each chop, so it's certainly possible. --TomEdwards 09:59, 1 Sep 2008 (PDT)
Whoa thats quite Interesting, I never knew this either, until seeing it right now. --Gear 20:10, 1 Sep 2008 (PDT)
Seeing your reactions, I believe I'm the only one facing this kind of situation? That's weird, I should do the test again, to see if there was not a problem with lightmaps at this moment. --NykO18 00:45, 2 Sep 2008 (PDT)
No no, I get it as well. That's how I counted the luxels. :-p --TomEdwards 00:57, 2 Sep 2008 (PDT)
All right, I believe it could be of some use to add this kind of information in your optimization article, or in the lightmap article. --NykO18 02:44, 2 Sep 2008 (PDT)

Powers of 2

Maybe this is obvious to those more experienced but I had a hard time figuring out that the lightmap scale must be a power of two. --VenatioDecorus 07:01, 23 April 2009 (UTC)

I'm pretty sure it doesn't have to be. --TomEdwards 18:21, 23 April 2009 (UTC)
It's best to keep it at half of the original usages, IE: 16, 8, 4, 2. There's usually a case though where you could use 1.--Gear 04:34, 24 April 2009 (UTC)
Remember that 4x4 pixels fit in one 1x1 hammer unit. Now, a lightmap scale of 1 means that the luxels will be one per hammer unit. Depending on the way you make your levels, if you were to use a lower resolution lightmap of something like scale 3, it will become miss-aligned on your brush, making the edges look terrible. Though, this all of course depends on how you have built your map. As a rule of thumb however I personally use powers of 2. It's also much easier to manage. --bacon333 03:12, 12 April 2010 (UTC)
That's not the case for textures, so why would it be for lightmaps? --TomEdwards 10:11, 12 April 2010 (UTC)
If there is half a lightmap luxel on the edge of a brush face, the lighting generally comes up looking 'hard'. Also, a 512x512 texture fits perfectly on a 128x128 brush, and so will any power-of-2 lightmap, so long as the texture is properly aligned. --bacon333 00:48, 2 May 2010 (UTC)


I maked a huge map with much static model, and conpile with scale 16 and 1 Lightmap. The FPS it was same (37 for me). So I think the performance isn't affect by Lightmap.

The map test :
Lightmap test.jpg

--Anarkia777 15:41, 27 July 2009 (UTC)

If I recall correctly lightmaps do not actually affect performance at all. They only take video ram memory space (and yes, take time to load), which textures also use. I'd therefore imagine it would be a good idea to compare the amount of textures you have in a map (as well as their sizes) compared to the number of high detail lightmaps you use, and weigh them with your budget in order to make sure the largest number of players can play your maps without lag from swapping in the Video ram. ---bacon333 03:01, 12 April 2010 (UTC)

High-density lightmaps will chop brushes into smaller items, but the effect of that is negligible on modern systems. --TomEdwards 10:11, 12 April 2010 (UTC)
Yes, that's correct. Good catch. --bacon333 00:44, 2 May 2010 (UTC)