wfowler1 / Unity3D-BSP-Importer

A lightweight plugin for importing BSP maps into Unity3D as meshes.
Other
111 stars 17 forks source link

Curves and corridors not being converted properly #4

Closed Wully616 closed 4 years ago

Wully616 commented 4 years ago

I'm trying to convert a map from JKA. (ffa3.bsp)

Some areas don't get converted properly. I've tried increasing the curve detail but it doesn't make a difference. I'm not getting any errors

Expected: https://imgur.com/a/n0xoBoW What im getting: https://imgur.com/a/TZ7gXp8

Any ideas?

wfowler1 commented 4 years ago

It's likely there's something in this game specifically that's different, so the information isn't being read or interpreted properly. I'll have to do some research around this game specifically. Hopefully it's not too difficult to figure out.

Usually these kinds of surfaces are defined as a two-dimensional array of quadratic curves. When turning these into meshes, these quadratics need to be sampled at points along the curve to build triangles. The curve detail option just increases the number of samples on these curves and therefore the number of triangles generated, creating a smoother mesh. This is assuming, of course, the data for the curves is found and interpreted properly, which it doesn't seem to be.

Wully616 commented 4 years ago

I understand, yeah the format for Jedi Knight is slightly different, I believe 2 lumps are treated different.

The game was open sourced and I believe there might be answers in the code. There is a bsptool in the source code which has the structs for the BSP format. https://github.com/grayj/Jedi-Academy/tree/master/code/bspthing

I'm not super familar with BSP in general otherwise I would attempt a PR against your LibBSP.

wfowler1 commented 4 years ago

Wow, that link is actually extremely helpful. I'll check it out over the weekend.

Wully616 commented 4 years ago

Was the source code of any benefit to adding support for Jedi Knight maps?

wfowler1 commented 4 years ago

Yes, but I've had a bit of a series of personal emergencies that came up. I haven't forgotten this! It's just a bit rough right now.

Wully616 commented 4 years ago

No problem at all! Life comes first.

I hope things get sorted for you soon


From: Will Fowler notifications@github.com Sent: Sunday, January 26, 2020 8:36:40 PM To: wfowler1/Unity3D-BSP-Importer Unity3D-BSP-Importer@noreply.github.com Cc: Wully616 william_robb9@hotmail.com; Author author@noreply.github.com Subject: Re: [wfowler1/Unity3D-BSP-Importer] Curves and corridors not being converted properly (#4)

Yes, but I've had a bit of a series of personal emergencies that came up. I haven't forgotten this! It's just a bit rough right now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wfowler1/Unity3D-BSP-Importer/issues/4?email_source=notifications&email_token=AAUVOFWIUUKPSSMDQANYSULQ7XX5RA5CNFSM4KEBZZFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ55IBQ#issuecomment-578540550, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUVOFWXH3V3OSOGUFJ6H43Q7XX5RANCNFSM4KEBZZFA.

wfowler1 commented 4 years ago

There were actually two problems breaking this. It should be fixed if you pull LibBSP and the importer. Let me know!

Wully616 commented 4 years ago

Amazing! Thank you.

At a cursory check, it does appear to have fixed the issue with curves

https://imgur.com/a/ivN0JDo

Wully616 commented 4 years ago

Looks great, the textures look perfect too! https://imgur.com/a/LlYlpgd Thanks again