lewa-j / Unity-Source-Tools

Plugin to import resources from the Source engine in Unity3D.
GNU General Public License v2.0
109 stars 22 forks source link

Lightmaps reset if the map was loaded in editor mode #18

Closed Fronkln closed 5 years ago

Fronkln commented 5 years ago

Self explanatory, if the map was loaded from editor with the "Load" button the generated lightmap texture will disappear on play mode

antim0118 commented 5 years ago

Yeah, its unity bug. It will always reset if shadows wasn't baked by unity. Solution: import lightmap to jpg/png/exr and apply it using "LightmapSettings" through script.

Fronkln commented 5 years ago

Yeah, its unity bug. It will always reset if shadows wasn't baked by unity. Solution: import lightmap to jpg/png/exr and apply it using "LightmapSettings" through script.

I converted it into a png image and loaded it today but it still wouldnt apply even though its at baked lightmaps list probably something specific needs to be done before it works properly

SavedScreen

The lightmap image that i used (city_test09.bsp)

antim0118 commented 5 years ago

I created this script to apply them. https://pastebin.com/sfmLsL4f I hope it will work.

Fronkln commented 5 years ago

I created this script to apply them. https://pastebin.com/sfmLsL4f I hope it will work.

Works perfectly, perhaps we should start integrating this into bsp loading itself that works when the app starts?