What happens to func_detail brushes in-game?

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

  1. Floof Waffles

    Floof Waffles L4: Comfortable Member

    Messages:
    199
    Positive Ratings:
    119
    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,842
    Positive Ratings:
    4,774
    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:
    1,019
    Positive Ratings:
    337
    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. Floof Waffles

    Floof Waffles L4: Comfortable Member

    Messages:
    199
    Positive Ratings:
    119
    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:
    162
    Positive Ratings:
    43
    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,842
    Positive Ratings:
    4,774
    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,429
    Positive Ratings:
    1,173
    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:
    162
    Positive Ratings:
    43
    Sorry! Gave ya the wrong rating but fixed it! ;)
     
  9. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    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:
    1,019
    Positive Ratings:
    337
    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,429
    Positive Ratings:
    1,173
    Less area, but more faces. To leave such a hole in a face, you need to cut it in multiple faces.