VRAD Compiling and order of expert compile options

Discussion in 'Mapping Questions & Discussion' started by Werewolf, Aug 5, 2014.

  1. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    723
    Positive Ratings:
    205
    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?
     
  2. henke37

    aa henke37

    Messages:
    1,857
    Positive Ratings:
    430
    Well, the source code to the tools is available.
     
  3. Geit

    aa Geit 💜 I probably broke it 💜

    Messages:
    597
    Positive Ratings:
    1,110
    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
     
    • Thanks Thanks x 1
    Last edited: Aug 5, 2014
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    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.
     
    • Thanks Thanks x 2
  5. henke37

    aa henke37

    Messages:
    1,857
    Positive Ratings:
    430
    It's a valid question, because some parsers are really sensitive to the order. Get the order wrong and the entire parser becomes confused.
     
  6. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    723
    Positive Ratings:
    205
    Well then, is Hammer parser sensitive?
     
  7. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,741
    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.
     
  8. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    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.
     
  9. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,215
    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.
     
  10. henke37

    aa henke37

    Messages:
    1,857
    Positive Ratings:
    430
    I am not sure that it does more light bounces. I think that it creates more initial light rays.
     
    • Thanks Thanks x 1
  11. Geit

    aa Geit 💜 I probably broke it 💜

    Messages:
    597
    Positive Ratings:
    1,110

    " -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.
     
  12. Lampenpam

    aa Lampenpam

    Messages:
    1,016
    Positive Ratings:
    337
    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?
     
  13. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,834
    Positive Ratings:
    4,753
    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.