Reduce Vrad time

TravisTouchdown

L2: Junior Member
Apr 15, 2013
68
5
I would like some tips from other map makers on the best was to reduce Vrad times. Right now my Vrad time is almost 20 minuets.

I have read over this page a few times but only understand half of it or so.
https://developer.valvesoftware.com/wiki/Visibility_optimization

I do have a couple questions to.

Does a reflective texture such as metal/metalchrome001 cause a longer Vrad time?

Do large open areas cause a longer Vrad time? I know the page talks about that but I want to hear it from another map maker.
 

Frosty Scales

L2: Junior Member
Mar 22, 2015
93
30

ics

http://ics-base.net
aa
Jun 17, 2010
841
543
Can i ask how long is your vrad time on -final and what is your cpu? Here on 3770 3,4GHz it's like 4-6 mins per LDR or HDR depending on which of my maps i compile. Using few of my maps as example, single pass of HDR vrad on pl_fifthcurve takes 5:34 to compile, as in pl_moonbase, it's 4:14 and that map is twice smaller but has more light sources and reflective surfaces. So you are fine if you are even under 10 mins with slower cpu on vrad compile.

Large open areas can cause more time to compile on vrad if there are many light sources or reflective surfaces. Yes, i think reflective surface adds little time to compile but not that it's significant thing. But basically you should not pay attention if the area is big or small. Only the light sources at it. If there is too many of those different light sources with different settings, then it takes long time and if there are too many of those, hammer will pull out an error during compile. Map still works ingame but can cause performance issues or bad lighting. You can have 10 lights with same settings but having 10 lights with different lighting settings will cause more time on compile.

While the video talks about lightmap scale and default is 16, making it 64 will make your game look bad. For TF2, i suggest you lightmap scale 64 only the roofs that you cannot see or other areas that aren't in players view that often. It's fine if player stickyjumps or rocketjumps to have some upper rooftops that cannot be set to nodraw with lightmap 64. Experiment during different compiles but remember that you only see the best result when compiled with -final option.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,697
2,581
No, reflective surfaces don't affect anything; they're treated as ordinary flat textures until the game starts up and the cubemaps are rendered.
 

TravisTouchdown

L2: Junior Member
Apr 15, 2013
68
5
Well here is my compile log on a normal compile. I have made like 120 maps from the past 3 years of mapping and i have never had a compile take this long. Can you take a look at it and tell me if anything looks out of the ordinary. I am removeing the map from it though in case one of my community members is reading this

** 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"

Valve Software - vbsp.exe (Jul 26 2016)
2 threads
materialPath: C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\materials
ConVarRef mat_reduceparticles doesn't point to an existing ConVar
Patching WVT material: nature/blendgroundtocobble003_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 (1)
Chop Details...done (0)
Find Visible Detail Sides...
Merged 284 detail faces...done (0)
Merging details...done (1)
FixTjuncs...
PruneNodes...
WriteBSP...
done (0)
writing mapname.prt...Building visibility clusters...
done (0)
*** Error: Skybox vtf files for skybox/sky_well_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_well_01 to build the default cubemap!
*** Error: Skybox vtf files for skybox/sky_well_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_well_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) (227987 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 1162 texinfos to 585
Reduced 71 texdatas to 66 (1483 bytes to 1281)

Wrote ZIP buffer, estimated size 1998, actual size 1516
16 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"

Valve Software - vvis.exe (Jul 26 2016)
2 threads
reading mapname.bsp
reading mapname.prt
613 portalclusters
1644 numportals
BasePortalVis: 0...1...2...3...4...5...6...7...8...9...10 (0)
PortalFlow: 0...1...2...3...4...5...6...7...8...9...10 (200)
Optimized: 0 visible clusters (0.00%)
Total clusters visible: 375769
Average clusters visible: 613
Building PAS...
Average clusters audible: 613
visdatasize:99310 compressed from 98080

3 minutes, 20 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" "

Valve Software - vrad.exe SSE (Jul 26 2016)

Valve Radiosity Simulator
2 threads
[Reading texlights from 'lights.rad']
unknown light specifier type - lights

[56 texlights parsed from 'lights.rad']


Setting up ray-trace acceleration structure... Done (0.81 seconds)
6943 faces
8510894 square feet [1225568768.00 square inches]
63 Displacements
299300 Square Feet [43099224.00 Square Inches]
6943 patches before subdivision
511931 patches after subdivision
sun extent from map=0.087156
36 direct lights
BuildFacelights: 0...1...2...3...4...5...6...7...8...9...10 (291)
BuildVisLeafs: 0...1...2...3...4...5...6...7...8...9...10 (826)
transfers 187701433, max 2358
transfer lists: 1432.0 megs
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (5)
Bounce #1 added RGB(44671, 51480, 19327)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (4)
Bounce #2 added RGB(14574, 14456, 4398)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (5)
Bounce #3 added RGB(5752, 4913, 1002)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (4)
Bounce #4 added RGB(1886, 1469, 231)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (4)
Bounce #5 added RGB(763, 543, 53)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (5)
Bounce #6 added RGB(254, 165, 12)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (4)
Bounce #7 added RGB(104, 63, 3)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (5)
Bounce #8 added RGB(35, 19, 1)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (5)
Bounce #9 added RGB(14, 7, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (4)
Bounce #10 added RGB(5, 2, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (4)
Bounce #11 added RGB(2, 1, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (5)
Bounce #12 added RGB(1, 0, 0)
Build Patch/Sample Hash Table(s).....Done<1.7115 sec>
FinalLightFace: 0...1...2...3...4...5...6...7...8...9...10 (37)
FinalLightFace Done
0 of 0 (0% of) surface lights went in leaf ambient cubes.
ThreadComputeLeafAmbient: 0...1...2...3...4...5...6...7...8...9...10 (64)
Writing leaf ambient...done
Ready to Finish

Object names Objects/Maxobjs Memory / Maxmem Fullness
------------ --------------- --------------- --------
models 16/1024 768/49152 ( 1.6%)
brushes 581/8192 6972/98304 ( 7.1%)
brushsides 4052/65536 32416/524288 ( 6.2%)
planes 2758/65536 55160/1310720 ( 4.2%)
vertexes 9790/65536 117480/786432 (14.9%)
nodes 1485/65536 47520/2097152 ( 2.3%)
texinfos 585/12288 42120/884736 ( 4.8%)
texdata 66/2048 2112/65536 ( 3.2%)
dispinfos 63/0 11088/0 ( 0.0%)
disp_verts 1575/0 31500/0 ( 0.0%)
disp_tris 2016/0 4032/0 ( 0.0%)
disp_lmsamples 747284/0 747284/0 ( 0.0%)
faces 6943/65536 388808/3670016 (10.6%)
hdr faces 0/65536 0/3670016 ( 0.0%)
origfaces 2024/65536 113344/3670016 ( 3.1%)
leaves 1502/65536 48064/2097152 ( 2.3%)
leaffaces 11350/65536 22700/131072 (17.3%)
leafbrushes 3164/65536 6328/131072 ( 4.8%)
areas 2/256 16/2048 ( 0.8%)
surfedges 39191/512000 156764/2048000 ( 7.7%)
edges 22324/256000 89296/1024000 ( 8.7%)
LDR worldlights 36/8192 3168/720896 ( 0.4%)
HDR worldlights 0/8192 0/720896 ( 0.0%)
leafwaterdata 1/32768 12/393216 ( 0.0%)
waterstrips 313/32768 3130/327680 ( 1.0%)
waterverts 0/65536 0/786432 ( 0.0%)
waterindices 5655/65536 11310/131072 ( 8.6%)
cubemapsamples 0/1024 0/16384 ( 0.0%)
overlays 0/512 0/180224 ( 0.0%)
LDR lightdata [variable] 25726832/0 ( 0.0%)
HDR lightdata [variable] 0/0 ( 0.0%)
visdata [variable] 99310/16777216 ( 0.6%)
entdata [variable] 33338/393216 ( 8.5%)
LDR ambient table 1502/65536 6008/262144 ( 2.3%)
HDR ambient table 1502/65536 6008/262144 ( 2.3%)
LDR leaf ambient 1996/65536 55888/1835008 ( 3.0%)
HDR leaf ambient 1502/65536 42056/1835008 ( 2.3%)
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/2224 ( 0.0%)
pakfile [variable] 1516/0 ( 0.0%)
physics [variable] 227987/4194304 ( 5.4%)
physics terrain [variable] 11755/1048576 ( 1.1%)

Level flags = 0

Total triangle count: 17059

21 minutes, 19 seconds elapsed

** Executing...
** Command: Copy File



** Executing...
** Command: "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\hl2.exe"
** Parameters: -game "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf" -heapsize 2097152 -novid -steam
 

Idolon

they/them
aa
Feb 7, 2008
2,115
6,122
While the video talks about lightmap scale and default is 16, making it 64 will make your game look bad. For TF2, i suggest you lightmap scale 64 only the roofs that you cannot see or other areas that aren't in players view that often. It's fine if player stickyjumps or rocketjumps to have some upper rooftops that cannot be set to nodraw with lightmap 64. Experiment during different compiles but remember that you only see the best result when compiled with -final option.

You can get away with low resolution lightmaps if a surface has uniform lighting, regardless of whether or not a player will be looking at it often. Dark ceilings and walls lit only by the sun's ambient are good candidates for scales of 64 and even beyond - I've seen as high (low?) as 512.
 

seth

aa
May 31, 2013
1,019
851
I spent several hours doing lightmap optimization passes on arena_goldtooth. Not only does it reduce compile time, it can drastically reduce file size. It's a great tool if used properly.

I used as high as 256 on some OOB displacements. As long as there are minimal shadow transitions on the faces you're editing, you can get pretty aggressive. You can also balance out the optimization with some higher resolution lightmaps in areas that will be traveled a lot, or in places that suffer from hard transitions.

I'm kind of going off on a tangent, I should write a guide about this. Suffice to say, doing lightmap opti will help you out.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,697
2,581
I wonder how big this map is. Even with optimization, something that's only at 7% brush count, with no special VRAD parameters, shouldn't take significantly longer to compile than over 100 other maps you've made.
 

TravisTouchdown

L2: Junior Member
Apr 15, 2013
68
5
So I will break this down to each post.

Frosty Scales
I watched your video. I will try that sometime. Answer me this cause I don't want to have re-watch it over and over, is it the smaller the number the finer the shadow? I dont really mess with that setting because shadow type and thickness isnt something that I worry about in my maps. Default shadows is fine with me.

ICS
my computer has 1.86 GHZ. When I compile it It just choose normal and I never check the High-dynamic-range box. I do like your suggestion about the roofs. I clip my roofs off cause I engineer friends who like to build on them. Would I still need to lightmap my roof if its clipped off?

Sevin
Is there a way to turn shadows off completely?

Pocket
I am not sure if this is what you mean by size but the VMF is 1.48mb in size and the BSP is 28 mb. The VMF is normal size for me and that is about 8 MB bigger then most BSP that I get. If that is not what your talking about the tell me what is and I will get you that information.


Now lets see. Do compile programs do anything to effect the time? I use the hammer and then sometimes I will use Valve Batch Compiler Tool and I when I posted this, I seen a neet one on this site that I will try out called Compile pal.
 

henke37

aa
Sep 23, 2011
2,075
515
Lightmaps are needed independently if player can access the area or not. They are needed for all surfaces the player can see. With the obvious omission of surfaces using the UnlitGeneric shader. And since nodraw can't be seen, it doesn't need a lightmap either (vbsp will even mark those faces as not getting a lightmap).
 

TravisTouchdown

L2: Junior Member
Apr 15, 2013
68
5
Well, after about 10 hours of map work, I finally finished it. The compile time was 41 minuets on normal and 145 minuets on ldr. I did learn some things from reading the stuff you all posted and watching that video 5 times. I cant wait for my MvM community to play this. We even had a contest to name the 3 businesses that I used in the map. Thank you all for sharing your knowledge with me. I will come back to the site more often and learn some more. I been mapping for 15 years or so since Quake and I am still learning new things. Maybe one day I will learn to use hammer.
 

henke37

aa
Sep 23, 2011
2,075
515
Uhm, normal IS ldr. You mean HDR. And you can skip HDR for everything but the final release. And even then it's optional and requires tweaking.
 

henke37

aa
Sep 23, 2011
2,075
515
They do. -StaticPropPolys is a tradeoff for the number of triangles considered for the light tracing. -StaticPropLighting is per vertex instead of per model light computation. -TextureShadows involves a texture lookup that is otherwise not done.

So they all have costs. But they are worth it.
 

TravisTouchdown

L2: Junior Member
Apr 15, 2013
68
5
That made a world of difference.

So I took my out of bounds displacements and set there lightmap to 120.
I set the roof lightmaps to 64
I added in those 3 commands

MY compile time went for 41 minuets on fast to 15 and normal compile from 145 minuets to 35. Those livable times with me.

Frosty Scales - Thank you for having those commands in your signature.

I finally got it done with a full compile and got it on the server. My map tester says that its a brilliant recreation of the 80s horror movie its based on.