What happens to func_detail brushes in-game?

Discussion in 'Mapping Questions & Discussion' started by Kapanyo, Aug 7, 2017.

  1. Kapanyo

    Kapanyo L3: Member

    Messages:
    115
    Positive Ratings:
    70
    So, I understand the whole deal of func_detailing anything that's not intrusive because it complicates the visleaves - but what happens to those brushes during gameplay? Are they visible all the time because they're not getting culled? Or do they still get culled? I'd like to know!
     
  2. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,818
    Positive Ratings:
    4,658
    func_detail's only job is to be ignored by VBSP when creating visleaves, so they don't play into the visibility calculation at all.
    Once in-game, they function identical to any other world brush, and will be culled or rendered along side them.
     
    • Thanks Thanks x 1
  3. Lampenpam

    aa Lampenpam

    Messages:
    991
    Positive Ratings:
    328
    type mat_wireframe 1 into console, and you see what's being rendered. Very helpfull to find optimization flaws in your maps.
     
    • Thanks Thanks x 1
  4. Kapanyo

    Kapanyo L3: Member

    Messages:
    115
    Positive Ratings:
    70
    So they're still culled for optimization? Okay, thanks, that's all I needed to know!
     
  5. [Rx.] Christian Troy

    [Rx.] Christian Troy L4: Comfortable Member

    Messages:
    154
    Positive Ratings:
    42
    What I have found through trial and error is that they are optimized by the compiler too but not as well as world brushes. If you compile a map with them in it, then in another compile have them moved to the world, you can see a big difference between how the two maps compile and their performance.

    I actually spent hours trying this out with different maps as a lot of peoples opinions conflicted.
     
  6. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,818
    Positive Ratings:
    4,658
    Yes, that's because in the second situation the func_detail brushes would have been cutting visleaves.

    func_details (almost) only decrease compile time. They exist for compile time optimisation - they don't increase performance. Theoretically your map will run BETTER the less func_details you have.
     
    • Like Like x 1
  7. Crowbar

    aa Crowbar perfektoberfest

    Messages:
    1,417
    Positive Ratings:
    1,138
    Worth noting that they prevent world (and other f_d) faces from being cut along with the visleaves, thus leaving less faces for the client to render overall in many cases.
     
  8. [Rx.] Christian Troy

    [Rx.] Christian Troy L4: Comfortable Member

    Messages:
    154
    Positive Ratings:
    42
    Sorry! Gave ya the wrong rating but fixed it! ;)
     
  9. henke37

    aa henke37

    Messages:
    1,832
    Positive Ratings:
    420
    I think the exact semantics is that the detail geometry is treated the same way as normal geometry is: each face is given an adjacent visleaf and rendered when that visleaf is potentially visible.
     
  10. Lampenpam

    aa Lampenpam

    Messages:
    991
    Positive Ratings:
    328
    Not sure what you mean with that.
    Func_detail usually leaves me with more faces to render because if a face is partly covered in func_detail, the whole face will be rendered in game (also also have full lighting informations). But if a world brush face is partly covered by another world brush, the covered part gets removed in game. Therefore the covered part is not being rendered and also has less lighting information saved.
     
    Last edited: Aug 8, 2017
  11. Crowbar

    aa Crowbar perfektoberfest

    Messages:
    1,417
    Positive Ratings:
    1,138
    Less area, but more faces. To leave such a hole in a face, you need to cut it in multiple faces.