project-navigation
Personal tools

Author Topic: Looking for tips on reducing polys  (Read 3158 times)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Looking for tips on reducing polys
« on: August 07, 2011, 04:45:11 pm »
For those that know the engine well (I'm thinking mattn and sandro_sleepy, maybe arisian if he's still around). Can you take a look at the following images and give me tips on how to reduce the unnecessary splitting of my geometry?

In particular, if there is some way to reduce the massive splitting that is occuring on my crates, which consist of a single brush marked as detail, but the brush is slightly rotated off grid. Of course, on grid would probably produce fewer polys, but I need them off grid to create that slightly messy look that makes it look "real".

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Looking for tips on reducing polys
« Reply #1 on: August 16, 2011, 04:31:10 pm »
At first, detail brushes in UFO:AI do not cause world brush splits, but can split each other -- they still are in the BSP tree. Older Quake engine got true detail objects (func_detail), but they got removed.

Second, those unnecessary splits are because BSPT builder heuristics chose bad splitplane from faces of nearby object and minced everything in the same node horisontally. And did that several times. To test that, I changed intial splitter (ConstructLevelNodes) to make splits every 128 units and snap them to 64 unit grid (old version was just recursively bisecting the map by longer axis until all segments are shorter than 256 units). That reduced bad splitting a lot, and also reduced face count for complex maps. For example, alienb2/ab_hub was reduced from 13.5K faces to 10.5K -- more than 20%. Guess that should be in master :)

Third, you can always use hint brushes to isolate geometry from being splitted or cause unneeded splits of nearby brushes. I've checked -- they work ok (sometimes there is a random split of unknown origin, but nothing more).

PS: All shots are from hub tile, right? You didn't say from which tiles they were taken ...

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Looking for tips on reducing polys
« Reply #2 on: August 16, 2011, 05:24:24 pm »
Thanks Sandro. Only the first shot is from the hub, the second and third are from the entrance.

I have been doing more with detail brushes to try and optimize and I'm also rebuilding some of the hub walls to reduce poly count. Whatever you did with the "splitter" that reduced bad splitting sounds great.

So, if I understand you correctly, two detail brushes that touch each other can split each other, even though they won't split the "regular" brushes around them? That's interesting, and could be the source of a lot of the polys in hub especially, where I have used a lot of boxes slightly rotated but stacked on top of each other.

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Looking for tips on reducing polys
« Reply #3 on: August 16, 2011, 06:43:14 pm »
So, if I understand you correctly, two detail brushes that touch each other can split each other, even though they won't split the "regular" brushes around them?

They do not need to touch each other -- even if face plane (which is infinite) of one brush intersects some other brush it can cause a split.


That's interesting, and could be the source of a lot of the polys in hub especially, where I have used a lot of boxes slightly rotated but stacked on top of each other.

That's possible.

PS: Will commit patch to compiler's initial splitter in a few hours.