Light Textures

obsidiian

L1: Registered
Jul 6, 2013
40
5
First off, the map I am working on is a jump map, not a regular map. I don't think my issue would come up in a normal size map, but because mine is a jump map, it's huge. Anyways, on to the issue...

Long Version:
I can compile my map with no problems. However, with a lightmap scale of 32 on all textures, I get a LDR leaf ambient of ~150%. This caused the map to go fullbright, which is obviously a problem. Raising the lightmap scale to 64 on all textures fixed this issue and brought LDR leaf ambient down to ~73% but made the shadows look really ugly. After a little while I came to the realization that my somewhat heavy use of light textures could be the issue. As of the time of posting, my map is 4/5 of the way done yet it's already pushing the lighting limits. Light textures are not exactly heavily used but they are definitely not rare throughout the map. I was told by a friend that light textures basically simulate a glowing texture by using tons of small lights a while ago, and I realized that this could be causing my problem. Basically what I would like to know is how the light textures work, whether or not they could be the issue, and if so, how should I go about finding a replacement texture?

Short Version:
I have light textures in my map and I think they're causing my map to hit 150% LDR leaf ambient with a lightmap scale of 32 on all textures. This forces the map into fullbright, basically ruining it. Bringing the scale up to 64 causes the LDR leaf ambient to fall to 73%. However, this causes ugly shadows. Are light textures my problem? If so, how can I fix them?

Compile Log:
** Executing...
** Command: "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\bin\vbsp.exe"
** Parameters: -game "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf" "C:\TF2\Source SDK Hammer\jump_apex_a2.vmf"

Valve Software - vbsp.exe (Oct 13 2014)
4 threads
materialPath: C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf\materials
Loading C:\TF2\Source SDK Hammer\jump_apex_a2.vmf
ConVarRef mat_reduceparticles doesn't point to an existing ConVar
Patching WVT material: maps/jump_apex_a2/nature/blendgroundtograss007_wvt_patch
Patching WVT material: maps/jump_apex_a2/dev/dev_blendmeasure2_wvt_patch
Patching WVT material: maps/jump_apex_a2/dev/dev_blendmeasure_wvt_patch
Patching WVT material: maps/jump_apex_a2/nature/blendconcretetograss001_wvt_patch
fixing up env_cubemap materials on brush sides...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
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...
Merged 624 detail faces...done (0)
Merging details...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (1)
writing C:\TF2\Source SDK Hammer\jump_apex_a2.prt...Building visibility clusters...
done (0)
*** Error: Skybox vtf files for skybox/sky_trainyard_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_trainyard_01 to build the default cubemap!
*** Error: Skybox vtf files for skybox/sky_trainyard_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_trainyard_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 (1) (1177018 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8.Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
.Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material KOTH_VIADUCT_EVENT/BLENDROCKGROUNDWALLFOREST_VIADUCT_EVENT002 uses unknown detail object type tf_forest_grass!
Material KOTH_VIADUCT_EVENT/BLENDROCKGROUNDWALLFOREST_VIADUCT_EVENT002 uses unknown detail object type tf_forest_grass!
Material KOTH_VIADUCT_EVENT/BLENDROCKGROUNDWALLFOREST_VIADUCT_EVENT002 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
Material NATURE/BLENDGROUNDTOGRASS007 uses unknown detail object type tf_forest_grass!
.9...10
Compacting texture/material tables...
Reduced 1214 texinfos to 833
Reduced 65 texdatas to 51 (1801 bytes to 1351)
Writing C:\TF2\Source SDK Hammer\jump_apex_a2.bsp
5 seconds elapsed

** Executing...
** Command: "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\bin\vvis.exe"
** Parameters: -game "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf" "C:\TF2\Source SDK Hammer\jump_apex_a2"

Valve Software - vvis.exe (Oct 13 2014)
4 threads
reading c:\tf2\source sdk hammer\jump_apex_a2.bsp
reading c:\tf2\source sdk hammer\jump_apex_a2.prt
3160 portalclusters
8272 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 (20)
Optimized: 2729 visible clusters (0.59%)
Total clusters visible: 466125
Average clusters visible: 147
Building PAS...
Average clusters audible: 330
visdatasize:363125 compressed from 2528000
writing c:\tf2\source sdk hammer\jump_apex_a2.bsp
21 seconds elapsed

** Executing...
** Command: "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\bin\vrad.exe"
** Parameters: -game "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf" "C:\TF2\Source SDK Hammer\jump_apex_a2"

Valve Software - vrad.exe SSE (Oct 13 2014)

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

Loading c:\tf2\source sdk hammer\jump_apex_a2.bsp
Setting up ray-trace acceleration structure... Done (1.71 seconds)
13290 faces
4 degenerate faces
19711090 square feet [2838396928.00 square inches]
34 Displacements
1465462 Square Feet [211026528.00 Square Inches]
13286 patches before subdivision
zero area child patch
131954 patches after subdivision
1091 direct lights
BuildFacelights: 0...1...2...3...4...5...6...7...8...9...10 (18)
BuildVisLeafs: 0...1...2...3...4...5...6...7...8...9...10 (11)
transfers 13644578, max 486
transfer lists: 104.1 megs
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #1 added RGB(488429, 355746, 323807)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #2 added RGB(77302, 41673, 35022)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #3 added RGB(17829, 6771, 5253)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #4 added RGB(4075, 1040, 760)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #5 added RGB(1124, 206, 153)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #6 added RGB(307, 36, 26)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #7 added RGB(93, 9, 7)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #8 added RGB(28, 2, 1)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #9 added RGB(9, 0, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #10 added RGB(3, 0, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #11 added RGB(1, 0, 0)
Build Patch/Sample Hash Table(s).....Done<0.1031 sec>
FinalLightFace: 0...1...2...3...4...5...6...7...8...9...10 (8)
FinalLightFace Done
0 of 874 (0% of) surface lights went in leaf ambient cubes.
ThreadComputeLeafAmbient: 0...1...2...3...4...5...6...7...8...9...10 (16)
Writing leaf ambient...done
Ready to Finish

Object names Objects/Maxobjs Memory / Maxmem Fullness
------------ --------------- --------------- --------
models 103/1024 4944/49152 (10.1%)
brushes 2986/8192 35832/98304 (36.5%)
brushsides 20005/65536 160040/524288 (30.5%)
planes 6198/65536 123960/1310720 ( 9.5%)
vertexes 20307/65536 243684/786432 (31.0%)
nodes 7908/65536 253056/2097152 (12.1%)
texinfos 833/12288 59976/884736 ( 6.8%)
texdata 51/2048 1632/65536 ( 2.5%)
dispinfos 34/0 5984/0 ( 0.0%)
disp_verts 2698/0 53960/0 ( 0.0%)
disp_tris 4256/0 8512/0 ( 0.0%)
disp_lmsamples 229872/0 229872/0 ( 0.0%)
faces 13290/65536 744240/3670016 (20.3%)
hdr faces 0/65536 0/3670016 ( 0.0%)
origfaces 7108/65536 398048/3670016 (10.8%)
leaves 8012/65536 256384/2097152 (12.2%)
leaffaces 15973/65536 31946/131072 (24.4%)
leafbrushes 7939/65536 15878/131072 (12.1%)
areas 3/256 24/2048 ( 1.2%)
surfedges 92151/512000 368604/2048000 (18.0%)
edges 56959/256000 227836/1024000 (22.2%)
LDR worldlights 1091/8192 96008/720896 (13.3%)
HDR worldlights 0/8192 0/720896 ( 0.0%)
leafwaterdata 25/32768 300/393216 ( 0.1%)
waterstrips 1075/32768 10750/327680 ( 3.3%)
waterverts 0/65536 0/786432 ( 0.0%)
waterindices 21408/65536 42816/131072 (32.7%)
cubemapsamples 0/1024 0/16384 ( 0.0%)
overlays 0/512 0/180224 ( 0.0%)
LDR lightdata [variable] 3165048/0 ( 0.0%)
HDR lightdata [variable] 0/0 ( 0.0%)
visdata [variable] 363125/16777216 ( 2.2%)
entdata [variable] 151165/393216 (38.4%)
LDR ambient table 8012/65536 32048/262144 (12.2%)
HDR ambient table 8012/65536 32048/262144 (12.2%)
LDR leaf ambient 47689/65536 1335292/1835008 (72.8%) //This is the issue
HDR leaf ambient 8012/65536 224336/1835008 (12.2%)
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/27666 ( 0.0%)
pakfile [variable] 3458/0 ( 0.0%)
physics [variable] 1177018/4194304 (28.1%)
physics terrain [variable] 10750/1048576 ( 1.0%)

Level flags = 0

Total triangle count: 36599
Writing c:\tf2\source sdk hammer\jump_apex_a2.bsp
54 seconds elapsed

** Executing...
** Command: Copy File
** Parameters: "C:\TF2\Source SDK Hammer\jump_apex_a2.bsp" "C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf\maps\jump_apex_a2.bsp"

The log posted is a compile with 64 lightmap scale.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
Every luxel (lightmap grid square) on a light-emitting texture generates the equivalent of an actual light entity at its center. You'll notice near the beginning of VRAD it says "1091 direct lights" which is your total actual light count including light entities and texlights. That's how they work.

Assuming you have a negligible amount of light entities (lets go with 91 for ease), when you have everything at 32 lightmap scale you would end up with 4000 texlights. I've only ran into (different) problems having an extremely high density of texlights in one area (I was using 1 unit luxels). However, the LDR lightdata entry is the actual lightmap data, so I would be reasonably confident to say the leaf ambient is somehow related to light entities themselves, which are used for stuff such as lighting dynamic models (players, weapons).

My suggestion, if your shadows are poor at 64, is to only make the texlight faces 64 and leave everything else (which will be receiving shadows) at 32. You can even get more specific than that if you like, lightmap optimzation can go a long way with huge maps. If you have really huge evenly lit faces (like outside, with nothing casting a shadow on them) you could get away with even 128 or 256 unit luxels.
 

UKCS-Alias

Mann vs Machine... or... Mapper vs Meta?
aa
Sep 8, 2008
1,264
816
On a side note to ABS. The skybox already does a similar effect. The scale on the textures there is 16, and everything is scaled up 16 times making it effectively 256 in size.

Its the main reason why in some maps you can see the moment the skybox starts. Mappers that compensate for that make those skybox textures only with a scale of 1 which makes it effectively 16 again. That is the point where people again wont notice.

The suggestion of ABS is probably best. If your light texture is very thin it wont give alot of lights:
A 16x256 texture at a 16 scale can only give 34 (2x17). At 64x64 with again a scale of 16 this already changes to 81 (9x9). In that last case reducing its scale to 32 would make it effectively only 25 (5x5) and people wont notice it.

Just devide the surface size by the scale and add 1. This gives the max number of lights that can be generated on 1 axis. And it also should help at deciding the problem giving textures.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
A 16x256 texture at a 16 scale can only give 34 (2x17). At 64x64 with again a scale of 16 this already changes to 81 (9x9). In that last case reducing its scale to 32 would make it effectively only 25 (5x5) and people wont notice it.
Took me a moment to figure out what you were trying to say with those numbers, which gave me a new point to mention: when you are going to the effort of considering lightmap scales on texlights, you should always be aligning the lightmap with the edges of the brush so you don't have excessive partial luxels.