VRAD Compiling and order of expert compile options

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Nice quick question. Does the order of any extra options you add in the expert options effect the end result? For example I compile with this most time:
Code:
-ldr -final -StaticPropLighting -StaticPropPolys -TextureShadows
I didn't think it mattered what order they were added in, because all will get done anyway. But when I discussed it with a friend, he believes that it does. In particular, the -final should be at the end because it 'finalises' the map.

So, could anyone shed any light on this?
 

henke37

aa
Sep 23, 2011
2,075
515
Well, the source code to the tools is available.
 

Geit

💜 I probably broke it 💜
aa
May 28, 2009
598
1,161
Werewolf [UK];306344 said:
Nice quick question. Does the order of any extra options you add in the expert options effect the end result? For example I compile with this most time:
Code:
-ldr -final -StaticPropLighting -StaticPropPolys -TextureShadows
I didn't think it mattered what order they were added in, because all will get done anyway. But when I discussed it with a friend, he believes that it does. In particular, the -final should be at the end because it 'finalises' the map.

So, could anyone shed any light on this?

They're all processed before compilation even starts, all they do is change specific settings within the compiler. It's possible that one setting could override another.

EDIT: https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/utils/vrad/vrad.cpp#L2350

Had a quick look through and found no flags that'd cause a conflict
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Analogy time because it popped into my head: launching an application is like placing your order at a restaurant. The command line flags are what the waitress writes down on her pad. The cook (application) then looks at them all and does what should be done.

This question is like asking "should I tell the waitress my appetizer first, because I want it before my entree?" Doesn't matter because they are both taken and then handled in the proper order.
 

henke37

aa
Sep 23, 2011
2,075
515
It's a valid question, because some parsers are really sensitive to the order. Get the order wrong and the entire parser becomes confused.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
I've never had any issues with the mirriad of orders I've used over the years. As long as every option is before -game, it doesn't matter.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
It's a valid question, because some parsers are really sensitive to the order. Get the order wrong and the entire parser becomes confused.
Sure. I never said it wasn't, I believe all questions should be asked if you don't know the answer. I just like analogies.
But nonetheless to continue my analogy then I'd just call that a lazy cook hired by a bad manager. (lazy programmer)

or at least, that should only be in cases of a program where the flags are explicitly affecting the same things, and the order they are processed in actually matters (like... image manipulation or something).

All the lighting steps need to happen in the order they need to happen, and letting them happen in the wrong order would pretty much be a bug.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Werewolf [UK];306344 said:
In particular, the -final should be at the end because it 'finalises' the map.
Well, in particular, this is wrong. -final means to do more light bounces than usual to ensure that areas in shadow get a more accurate amount of reflected light. For example, anyone who's tried to compile a 2fort edit with standard settings has probably noticed that the spawn room ceilings turn out too dark. It might also aid in avoiding the splotchy colors that appeared in, say, that one map we played last week where BLU's spawn accidentally had no lighting.
 

henke37

aa
Sep 23, 2011
2,075
515
I am not sure that it does more light bounces. I think that it creates more initial light rays.
 

Geit

💜 I probably broke it 💜
aa
May 28, 2009
598
1,161
Well, in particular, this is wrong. -final means to do more light bounces than usual to ensure that areas in shadow get a more accurate amount of reflected light. For example, anyone who's tried to compile a 2fort edit with standard settings has probably noticed that the spawn room ceilings turn out too dark. It might also aid in avoiding the splotchy colors that appeared in, say, that one map we played last week where BLU's spawn accidentally had no lighting.


" -final : High quality processing. equivalent to -extrasky 16."
" -extrasky n : trace N times as many rays for indirect light and sky ambient."
So -final and -extrasky would conflict with one another depending on the order of the arguments, whichever one is last will take precedence.
 
Mar 23, 2013
1,013
347
" -final : High quality processing. equivalent to -extrasky 16."
" -extrasky n : trace N times as many rays for indirect light and sky ambient."
So -final and -extrasky would conflict with one another depending on the order of the arguments, whichever one is last will take precedence.

This is why I think that -final is compleetly unecessary. The lightgrid scale is usually too big that you would notice any change then compiling with or without -final. It'll just make your compile a lot longer.
Or am I wrong?
 

Freyja

aa
Jul 31, 2009
2,994
5,813
The lightmap scale doesn't matter. It changes the brightness of those regardless. It's not really a big thing in most circumstances, but in areas of low light sometimes the -final will cast rays there where a normal compile wouldn't causing light to appear where it wasn't before. -final is a much more accurate (comparatively) lighting calculation.