LogicalError / realtime-CSG-for-unity

Realtime-CSG, CSG level editor for Unity
https://realtimecsg.com
MIT License
761 stars 80 forks source link

Lightmap UV update crashes unity unwrapper #254

Closed brumley53 closed 5 years ago

brumley53 commented 6 years ago

Whenever I try to update the lightmap UV's I get an error message saying "UnwrapCL.exe has stopped working". I'm not sure if this problem comes from RealtimeCSG or if it's a unity problem but I think it might be on RealtimeCSG's end because I can get it to work fine if I move or delete certain brushes. If I try to bake lighting after this I get an error saying the UV's have zero area and the model ends up with no lighting.

LogicalError commented 6 years ago

This is a Unity bug unfortunately .. I'm not sure what I can do about it .. :( Please report a bug to Unity. AFAIK this is something that happens in the 2018.1 only .. if you are on 2018.1 be sure to try out the latest versions because it may have been fixed there?

Henry00IS commented 6 years ago

No actually SabreCSG coincidentally has this exact same problem, I am even more devastated reading that even you with much cleaner mesh geometry get these crashes. It happens in the 2017 versions as well. I scoured the internet for hours and no-one knows the reason. I tried taking UnwrapCL.exe and .dll from Unity 5.3 where it appears to work but it will crash when used with a newer Unity. Probably because the binary file format in /Temp/ that Unity uses to exchange data with it is different.

You work at Unity, maybe you can fix it! :grin:

LogicalError commented 6 years ago

@Henry00IS I noticed that it crashes with certain unwrap parameters, so watch out for that.. I'm considering writing my own lightmap UV generation .. once I get some other things out of the way

Henry00IS commented 6 years ago

The enemy of my enemy (UnwrapCL.exe) is my friend, right? So that means you will make it an open source MIT licensed project and we collaborate? Pretty please? 🤞

I mean when I fix some issues or add a feature (or anyone for that matter) then you'd benefit from it too! I'd even be willing to add a RealtimeCSG advertisement in Sabre's preferences window if that's what it takes. Haha 😁

RealtimeCSG Lightmapper Inside®

LogicalError commented 6 years ago

Ah sorry, if I write a lightmap uv generator it will be tightly coupled with realtime-CSG to avoid redundant calculations. There's basically information available in the CSG tree that I can re-use for a uv generator. An open source variant would have to rebuild a lot of information, wasting CPU time .. which would make it a lot less useful for me, trying to be real-time and all

brumley53 commented 6 years ago

Oh I forgot to post here a while back but I managed to fix the problem on my end. I was using 2017.3.0f3 and updating to 2017.4.1f1 seems to have fixed the problem.

Henry00IS commented 6 years ago

Fantastic news! Confirmed that 2017.4.5f1 does not have this problem over at Sabre. Unity fixed this entire issue.