Increasing The Max. Number Of Lights

butter_milch

L1: Registered
Feb 13, 2011
16
0
The maxium number of lights according to Hammer is 8192. Is there any way to increase this limit?
 

RagnarHomsar

L2: Junior Member
Aug 22, 2010
59
19
Why would you need more than 8192 lights? The most I can think of as necessary for any map in Source is in the hundreds.

To answer the question, there's no method that I know of and none that I could find. It's probably hardcoded into Hammer.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
The question is, what kind of monster are you creating. Hitting the limits usually means you're doing something horribly wrong, not that source is restricting you. (although source is a bit old and some of the limits aren't limits anymore)

(pictures are necessary)
 
Jun 19, 2009
812
814
The question is, what kind of monster are you creating. Hitting the limits usually means you're doing something horribly wrong, not that source is restricting you. (although source is a bit old and some of the limits aren't limits anymore)

(pictures are necessary)

Don't worry, it will come alive eventually... mwahahaha
frankenstein.jpg
 

butter_milch

L1: Registered
Feb 13, 2011
16
0
These are the little monsters we're talking about:



The small cube adds 48, the medium sized one 98 and the big one 200 lights to the map so a limit of 8192 is pretty low imo ( I'm trying to add quite a lot of them to different rooms).

I'm not experiencing any performance issues so I would like to add lights/cubes until I do but hammer won't stop whining.

The lighting is achieved through neon textures (lights.rad: neon/white 255 255 255 10).
 

Dustoxx

L6: Sharp Member
Jan 9, 2009
304
43
does that really take so much lights to make? strange.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Texlights, as I assumed when I saw the title. They're the only reason anyone ever runs into the limit.

Every luxel creates one light at it's center. Luxel size is determined by the "lightmap" property on the face edit dialog. Raising it will cut your numbers significantly, but also lower the "resolution" and result in spottier lighting when the surface is really close to something. You can already see some of that next to the medium cubes on the surface of the big one and the main wall.

Another suggestion would be to miter the corners, so you only have one face per edge with texlight, instead of two per edge.
 
Jan 20, 2010
1,317
902
These are the little monsters we're talking about:



The small cube adds 48, the medium sized one 98 and the big one 200 lights to the map so a limit of 8192 is pretty low imo ( I'm trying to add quite a lot of them to different rooms).

I'm not experiencing any performance issues so I would like to add lights/cubes until I do but hammer won't stop whining.

The lighting is achieved through neon textures (lights.rad: neon/white 255 255 255 10).

Tron?
 

Fruity Snacks

Creator of blackholes & memes. Destroyer of forums
aa
Sep 5, 2010
6,394
5,571
Thats what I first though....

Though, I've done this before, I just made 6 brushes, arranged them to have a gap like that, and stuck a light ent in the morning...

This, though, was for my very first map (before offtrack) that I never showed anyone, and I believe has been deleted off my computer.
 

butter_milch

L1: Registered
Feb 13, 2011
16
0
Texlights, as I assumed when I saw the title. They're the only reason anyone ever runs into the limit.

Every luxel creates one light at it's center. Luxel size is determined by the "lightmap" property on the face edit dialog. Raising it will cut your numbers significantly, but also lower the "resolution" and result in spottier lighting when the surface is really close to something. You can already see some of that next to the medium cubes on the surface of the big one and the main wall.

Another suggestion would be to miter the corners, so you only have one face per edge with texlight, instead of two per edge.

Thank you, that's just the info I needed. But what's funny is that setting the lightmap scale from 16 to 64 actually made it look much better, it's not spotty at all. Lowering it to 8 or 2 will make it spotty and multiply the number of direct lights. (Only checked that with the medium cube - big cube seems to have a spot - I'll look into that).

The number of used direct lights dropped from (medium sized cube) 98 to 26 with a lms of 64 and 2 faces per corner. I used more faces per corner before because I thought it would be better at illuminating the sides but that is not the case.

Great, now I can get this thing started on a massive scale :)

PS: Not Tron. Just a nice clean stylish cube ^^
 
Last edited:

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
I believe pl_rainbowride has texlighting on all of the light-colored stripes in its paths; I'm curious now how many light entities it has.
 

ardysqrrl

L4: Comfortable Member
Oct 26, 2009
173
159
5262 direct lights. All the "strips" of light are 16 units thick with texlight density 4. It was pretty spotty with the default of 16.

I've run into this limit several times, but it's not too difficult to work with.
 

A554551N4710N

L1: Registered
Mar 21, 2011
1
0
These are the little monsters we're talking about:



The small cube adds 48, the medium sized one 98 and the big one 200 lights to the map so a limit of 8192 is pretty low imo ( I'm trying to add quite a lot of them to different rooms).

I'm not experiencing any performance issues so I would like to add lights/cubes until I do but hammer won't stop whining.

The lighting is achieved through neon textures (lights.rad: neon/white 255 255 255 10).

those are beautiful!! hope you find a way of acheiving your goal of more lights!
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Or you could just use a highly reflective material with a default pure white texture so that it looks it it's emitting light when infact it's merely reflecting it from 1 or 2 sources. Of course the texture wouldn't directly light nearby surfaces but then that's purely aesthetic and i personally find it reduces the emphasis of the actual trims; and any HDR should make it at least appear as if the texture is emitting light at the player.

I haven't done this myself so i have no idea if it'd work to your desires or even look like how i imagine it; but it's a potential alternative that allows you to work within the light count limitations.
 
Last edited:

butter_milch

L1: Registered
Feb 13, 2011
16
0
Thx assassination :)

Sounds like a great idea grazr. I was thinking about casing them in glass for a more shiny look.

Atm. I've managed to limit the ammount of lights to ~7500 and I'm content with the number of cubes I can use.

But here's the next problem I haven't been able to fix:



and



They look like a compiling errors to me and only appear when adding a lot of cubes to the map.

Here's the compiling log (final compile - took over 1.5 hours)

Code:
** Executing...
** Command: "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk\bin\orangebox\bin\vbsp.exe"
** Parameters: -game "d:\games\installiert\steam\steamapps\dargoth_nonestil\team fortress 2\tf" "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2"

Valve Software - vbsp.exe (Jul  7 2010)
4 threads
materialPath: d:\games\installiert\steam\steamapps\dargoth_nonestil\team fortress 2\tf\materials
Loading d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.vmf
ConVarRef mat_reduceparticles doesn't point to an existing ConVar
"materials/tools/locked.vtf": cached version doesn't exist
Patching WVT material: maps/unusual_trading_hub_v2/dev/dev_blendmeasure_wvt_patch
fixing up env_cubemap materials on brush sides...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (1)
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
Processing areas...done (0)
Building Faces...done (0)
Chop Details...done (0)
Find Visible Detail Sides...done (0)
Merging details...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (0)
writing d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.prt...Building visibility clusters...
done (1)
*** Error: Skybox vtf files for skybox/sky_trainnight_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_trainnight_01 to build the default cubemap!
*** Error: Skybox vtf files for skybox/sky_trainnight_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_trainnight_01 to build the default cubemap!
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (7) (559137 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Water found with no water_lod_control entity, creating a default one.
Compacting texture/material tables...
Reduced 1204 texinfos to 481
Reduced 46 texdatas to 39 (1207 bytes to 923)
Writing d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.bsp
27 seconds elapsed

** Executing...
** Command: "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk\bin\orangebox\bin\vvis.exe"
** Parameters: -game "d:\games\installiert\steam\steamapps\dargoth_nonestil\team fortress 2\tf" "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2"

Valve Software - vvis.exe (Jul  7 2010)
4 threads
reading d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.bsp
reading d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.prt
1328 portalclusters
4643 numportals
BasePortalVis:       0...1...2...3...4...5...6...7...8...9...10 (1)
PortalFlow:          0...1...2...3...4...5...6...7...8...9...10 (7560)
Optimized: 2423 visible clusters (0.00%)
Total clusters visible: 813779
Average clusters visible: 612
Building PAS...
Average clusters audible: 825
visdatasize:289670  compressed from 446208
writing d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.bsp
2 hours, 6 minutes, 1 second elapsed

** Executing...
** Command: "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk\bin\orangebox\bin\vrad.exe"
** Parameters: -final -StaticPropPolys -TextureShadows -StaticPropLighting -game "d:\games\installiert\steam\steamapps\dargoth_nonestil\team fortress 2\tf" "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2"

Valve Software - vrad.exe SSE (Jul  7 2010)

      Valve Radiosity Simulator     
4 threads
[Reading texlights from 'lights.rad']
[1 texlights parsed from 'lights.rad']

Loading d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.bsp
Setting up ray-trace acceleration structure... Done (1.12 seconds)
5677 faces
11 degenerate faces
1256369 square feet [180917216.00 square inches]
0 Displacements
0 Square Feet [0.00 Square Inches]
5666 patches before subdivision
zero area child patch
zero area child patch
zero area child patch
zero area child patch
zero area child patch
zero area child patch
zero area child patch
zero area child patch
69986 patches after subdivision
7554 direct lights
BuildFacelights:     0...1...2...3...4...5...6...7...8...9...10 (920)
BuildVisLeafs:       0...1...2...3...4...5...6...7...8...9...10 (23)
transfers 19795822, max 1947
transfer lists: 151.0 megs
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (1)
	Bounce #1 added RGB(88867, 86162, 86360)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #2 added RGB(12009, 11393, 11459)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (1)
	Bounce #3 added RGB(1814, 1693, 1706)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #4 added RGB(311, 289, 291)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #5 added RGB(59, 55, 55)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (1)
	Bounce #6 added RGB(12, 12, 12)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #7 added RGB(3, 3, 3)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (1)
	Bounce #8 added RGB(1, 1, 1)
Build Patch/Sample Hash Table(s).....Done<0.0317 sec>
FinalLightFace:      0...1...2...3...4...5...6...7...8...9...10 (6)
FinalLightFace Done
6547 of 7551 (86% of) surface lights went in leaf ambient cubes.
ThreadComputeLeafAmbient: 0...1...2...3...4...5...6...7...8...9...10 (658)
Writing leaf ambient...done
Ready to Finish

Object names       Objects/Maxobjs  Memory / Maxmem  Fullness 
------------       ---------------  ---------------  -------- 
models                  55/1024         2640/49152    ( 5.4%) 
brushes               1222/8192        14664/98304    (14.9%) 
brushsides           13618/65536      108944/524288   (20.8%) 
planes               16922/65536      338440/1310720  (25.8%) 
vertexes              9660/65536      115920/786432   (14.7%) 
nodes                 3947/65536      126304/2097152  ( 6.0%) 
texinfos               481/12288       34632/884736   ( 3.9%) 
texdata                 39/2048         1248/65536    ( 1.9%) 
dispinfos                0/0               0/0        ( 0.0%) 
disp_verts               0/0               0/0        ( 0.0%) 
disp_tris                0/0               0/0        ( 0.0%) 
disp_lmsamples           0/0               0/0        ( 0.0%) 
faces                 5677/65536      317912/3670016  ( 8.7%) 
hdr faces                0/65536           0/3670016  ( 0.0%) 
origfaces             3772/65536      211232/3670016  ( 5.8%) 
leaves                4003/65536      128096/2097152  ( 6.1%) 
leaffaces             6332/65536       12664/131072   ( 9.7%) 
leafbrushes           2433/65536        4866/131072   ( 3.7%) 
areas                    6/256            48/2048     ( 2.3%) 
surfedges            47266/512000     189064/2048000  ( 9.2%) 
edges                26338/256000     105352/1024000  (10.3%) 
LDR worldlights       7554/8192       664752/720896   (92.2%) VERY FULL!
HDR worldlights          0/8192            0/720896   ( 0.0%) 
leafwaterdata            1/32768          12/393216   ( 0.0%) 
waterstrips            400/32768        4000/327680   ( 1.2%) 
waterverts               0/65536           0/786432   ( 0.0%) 
waterindices          6255/65536       12510/131072   ( 9.5%) 
cubemapsamples           7/1024          112/16384    ( 0.7%) 
overlays                 0/512             0/180224   ( 0.0%) 
LDR lightdata         [variable]     1255388/0        ( 0.0%) 
HDR lightdata         [variable]           0/0        ( 0.0%) 
visdata               [variable]      289670/16777216 ( 1.7%) 
entdata               [variable]       67006/393216   (17.0%) 
LDR ambient table     4003/65536       16012/262144   ( 6.1%) 
HDR ambient table     4003/65536       16012/262144   ( 6.1%) 
LDR leaf ambient     14713/65536      411964/1835008  (22.5%) 
HDR leaf ambient      4003/65536      112084/1835008  ( 6.1%) 
occluders                0/0               0/0        ( 0.0%) 
occluder polygons        0/0               0/0        ( 0.0%) 
occluder vert ind        0/0               0/0        ( 0.0%) 
detail props          [variable]           1/12       ( 8.3%) 
static props          [variable]           1/12       ( 8.3%) 
pakfile               [variable]        2368/0        ( 0.0%) 
physics               [variable]      559137/4194304  (13.3%) 
physics terrain       [variable]           2/1048576  ( 0.0%) 

Level flags = 1

Total triangle count: 18122
Writing d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.bsp
26 minutes, 52 seconds elapsed

** Executing...
** Command: Copy File
** Parameters: "d:\games\installiert\steam\steamapps\dargoth_nonestil\sourcesdk_content\tf\mapsrc\unusual_trading_hub_v2.bsp" "d:\games\installiert\steam\steamapps\dargoth_nonestil\team fortress 2\tf\maps\unusual_trading_hub_v2.bsp"

Checked it with this analyzer (http://flow.computer-dc.de/analyzer.php) and found the following errors:

"Degenerate Faces" and "zero area child patch"

I think all the lights are too much for the compiling process. Any way to make the whole thing more stable?

I'll try working without the self illuminating texture on the cubes, add glass to them and probably use a light_spot to light them up. Let's see what happens :)
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
You want to limit the amount of "activity" within a single area. What i mean by that is if there's a lot to calculate for vrad or vvis in a single location it'll eat your memory and potentially crash your compile (or at least give you errors).

That or it's a corruption during the copy and paste process. Or any number of other less likely possibilities that come to mind.

P.S. This is maybe a more comprehensive log analyser:

http://www.interlopers.net/errors/

EDIT: Judging by the way the cube with the hole in it has culled a square patch of texture in the floor, i have to ask, are these func_detail'ed? That would be a big issue if that's not the case.
 
Last edited:

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Oh! I just now realized. You could make it so they only use actual light textures on sides that face stuff that light would reflect off of, and just use selfillum for the others.
 

butter_milch

L1: Registered
Feb 13, 2011
16
0
I want a "natural" feeling to it. As you can see the whole corner is lit although people won't stand there. I think it just looks better that way :)

@grazr: I func_detailed them and bam - perfect - no errors. Why did that help exactly? Is there a list of things every mapper should know? Like what to func_detail for instance? I could really use a guide like that :)
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
You'll learn from experience, if i were to discuss many of the common problems it'd become a massive article and i'd probably miss many things. Just read tutorials and solve the problems as they come.