Ayfel / PrefabLightmapping

Script for saving lightmapping data to prefabs. Used through the Assets tab in Unity. Place your prefbas in the scene with this script at the root. Set up your lighting and in the editor go to Assets->Bake Prefab Lightmaps. After is processed you can now spawn your prefabs in different scenes and they will use the lightmapping from the original scene.
618 stars 88 forks source link

Light probes? #40

Open adnanel opened 2 years ago

adnanel commented 2 years ago

Hello

I'm using this script for prefab lightmapping, and it works really well. But one thing that I noticed is that light probes don't seem to work in the instantiated prefab instances. However, in the scene where I bake my prefab, they work very well.

Is this a known issue/limitation? Any way to get them working?

adnanel commented 2 years ago

I have found a related issue https://github.com/Ayfel/PrefabLightmapping/issues/19 where this was discussed.

Any news on this script where probe lights are calculated at runtime?

Ayfel commented 2 years ago

Hi , I have a version for lightprobes but I need to integrate it. Let me see if this week or next I can finish and include that in the project

Delaquarix commented 2 years ago

Hi,

We've just started using this tool as well and it's a lifesaver! I was wondering if you had any chance to work on getting the light probes to work with instantiated prefabs.

Thanks.

Ayfel commented 2 years ago

I have a script for it, I think I might upload it on its own repo. But I will make an announcement here with what the "final" version of that is, hopefully very soon.

Delaquarix commented 2 years ago

Thanks for the swift response!

Apoll0 commented 2 years ago

We started to use the tool too. It's very helpful so any news about light probes? )

Apoll0 commented 2 years ago

Any news about lightprobes support? )

Ayfel commented 2 years ago

Ok I am adding a new script to the repo, it works as follows:

-The only setup you need is to create light probes in the scene you will instantiate your rooms in and then do an "empty" bake in that scene. Then this script (LightProbeRuntime.cs) will be in that scene where you instantiate prefabs, and it will wait a frame to calculate the light volume contribution from the lights in the scene (so for this to work properly you need to have those lights be a part of the prefabs rooms/assets you bake, so this script finds the lights and adds their "would be" contribution to the probes). You can easily tweak this to call it at will if you prefer to recalculate probes at different times.