twhl-community / HalfLife.UnifiedSdk.MapDecompiler

Cross-platform Half-Life 1 map decompiler
GNU General Public License v2.0
64 stars 7 forks source link

Can't decompile triangle mesh ? #30

Closed UnrealKaraulov closed 6 months ago

UnrealKaraulov commented 7 months ago

gign.zip

UnrealKaraulov commented 7 months ago

image

UnrealKaraulov commented 7 months ago

image image

UnrealKaraulov commented 7 months ago

de_dust2_with_gign.zip Full sample (model gign.mdl added to de_dust2 via 'map->mdl to bsp(wip)' feature from newbspguy)

I got bad decompile result with latest release ( https://github.com/twhl-community/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V1.0.0.0 )

image

UnrealKaraulov commented 7 months ago

Another map example, why Tree decompiler can't decompile this map?

image random_lowpoly_map.zip

karakakarkarkar commented 7 months ago

@SamVanheer face-to-brush produces an incredible amount of extra vertices. But for one face, one vertex is quite enough. Also your face-to-brush decompiler cant detect true face side.

Possible need to invert dist for planeside with normal.

if (face->nPlaneSide)
{
    BSPPLANE backplane = bsp->planes[face->iPlane];
    backplane.fDist = -backplane.fDist;
    backplane.vNormal = backplane.vNormal.invert();
    return backplane;
}
else
{
    return bsp->planes[face->iPlane];
}
UnrealKaraulov commented 6 months ago

@