Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
299 stars 52 forks source link

Add mbspc face-to-brush with best merge faces #171

Closed karakakarkarkar closed 3 months ago

karakakarkarkar commented 3 months ago

Possible to merge all faces(with same parameters) and then split to convex faces for decompile?

I think this can decrease output brushes count?

Also for face-to-brush need only one vertex (for example centroid of face - 4.0f offset)

https://github.com/UnrealKaraulov/newbspguy/blob/892107e076eb68cc625ec660222ea1055b419d7a/src/bsp/Bsp.cpp#L9353

Garux commented 3 months ago

Brush per face decompiler exists, it's less usable result.

karakakarkarkar commented 3 months ago

@Garux yes but maybe can be improved by adding

  1. Remove faces with CONTENT_SKY and CONTENT_SOLID
  2. Merge all faces( even concave?)
  3. Split for convex faces

This can give better results and more small output brush count.

And generate one back point for one brush with center offset, front textured, back textured for example with NULL when possible (just one plane for every edge + back_vert) , but very bad that no special texture for skip back faces and generate nodes/clipnodes for front face)

Garux commented 3 months ago

Ic no point in reinventing the wheel https://github.com/twhl-community/HalfLife.UnifiedSdk.MapDecompiler/issues/31, while it doesn't produce somewhat similar to original brushes anyway. Pull request would be highly appreciated ofc!

Side note: pyramidal brushes are expected to be way less efficient in bsp, compared to using axial planes.

UnrealKaraulov commented 3 months ago

@Garux how to use face-to-brush algorithm in mbspc ? or this only tree decompiler ?

Garux commented 3 months ago

only tree decompiler