what an incredible and untapped element of the game dev experience. you have changed my game drastically not only with lighting but I have learned more about manipulating arrays which is something I really need for my inventory
I was able to build the two sets of light maps for Dark and Light, but I can't get them to switch using the LightSettings.lightmaps = ___ like in the example. The files are in the correct order on the input parameters
Hello! Thank you very much for your help! It helped me a lot. What I'm trying to do now is also change the reflections that were created as a Cubemap, do you have any idea how I could do it?
That's really cool But Would you also be able to do this with only turning off one light at a time? Because right now it turns off all lights, but what if I want to have a feature where a player could shoot out a light for instance without relying on baked lighting?
Im getting the following error in your provided script: The type or namespace name 'UserInputMap' could not be found (are you missing a using directive or an assembly reference?) any solution?
It's a custom InputMap name generated from InputAction object that you create with Unity's New Input System, check out their docs on how to create InputMap and be sure to have "Generate C# Code" ticked in said asset options (Click on InputActions and select it in Inspector)
I am aware, that is/or was because of TH-cam policy that doesn't allow unverified accounts for posting links in the video descriptions. I'll update them as soon as possible when I get verified.
It's lighter than using realtime lighting because your GPU doesn't need to recalculate lightmap everytime a light changes. But it has some limits, like for example you have to bake every possible light state if you want to have more than 2 lightmaps. Althought it allows for a better fine-tuned lighting. And remember, you can always mix baked and realtime lights
@@mad_man_86 let me know if you got the transition to work, I’m using unity 2023 and can’t get it to switch back and forth. I was close with switching to a dark mode with baked light and back to a light mode without any baked lights but still wasn’t right.
@@ericzwirnmann8151 It works, but the way I do it now is keep the lighting data asset in the scene folder and just copy the images (using the windows explorer) into separate folders. Works great now :)
I assume you'd have to modify LightmapSettings.lightProbes where you need to assign new LightProbes variable, which has bakedProbes array that contains all of the scene's baked probes that you need to set
@@S111A111S They are placed by Unity in the Scene folder that is being created by baking the scene lightning. The filename of them is called ReflectionProbe-n.exr, where n represents the reflection probe number I assume. I think you should be fine by just dragging that file onto the reflection probe field in the inspector.
what an incredible and untapped element of the game dev experience. you have changed my game drastically not only with lighting but I have learned more about manipulating arrays which is something I really need for my inventory
Bro, tutorials on stuff as specific as this are so incredibly useful. Thanks a lot for this.
Bro's voice so hot it actually BAKED me
this helped a lot! thank you!
btw you have to make sure that the textures are properly ordered in the array (or you'll have the problems I had)
Love you brother. This is so useful and straight to the point. Thanks a lot.
I wonder if it's possible to lerp between the different lightmaps? Like a transition effect over time (day - night).
Yes, we can
Can I use the script in my commercial game project?
Hey! I know you already expplained the UserInputMap error, but i don't really understand how to do it. Do you have any guide or something for it?
This is GOOOOOD
I was able to build the two sets of light maps for Dark and Light, but I can't get them to switch using the LightSettings.lightmaps = ___ like in the example. The files are in the correct order on the input parameters
Do you know if we can lerp from one lightmap to the other? To have a smooth transition
how could i put this to a player toggle interact button in game? im a bit lost at the part where they seem to be keyboard bindings.
THANK YOU!
Brilliant! Subbed! More please!!!
Hello! Thank you very much for your help! It helped me a lot. What I'm trying to do now is also change the reflections that were created as a Cubemap, do you have any idea how I could do it?
That's really cool
But
Would you also be able to do this with only turning off one light at a time? Because right now it turns off all lights, but what if I want to have a feature where a player could shoot out a light for instance without relying on baked lighting?
good tutorial bro,
Im getting the following error in your provided script:
The type or namespace name 'UserInputMap' could not be found (are you missing a using directive or an assembly reference?)
any solution?
It's a custom InputMap name generated from InputAction object that you create with Unity's New Input System, check out their docs on how to create InputMap and be sure to have "Generate C# Code" ticked in said asset options (Click on InputActions and select it in Inspector)
The links in the description are broken btw. Neat showcase.
I am aware, that is/or was because of TH-cam policy that doesn't allow unverified accounts for posting links in the video descriptions. I'll update them as soon as possible when I get verified.
@@ClickyDev bro you still not verified T_T pls, comment the links. i really need it. REALLY APPRICIATE THE TUTORIAL as well
thanks, subbed
How heavy is this operation?
It's lighter than using realtime lighting because your GPU doesn't need to recalculate lightmap everytime a light changes. But it has some limits, like for example you have to bake every possible light state if you want to have more than 2 lightmaps. Althought it allows for a better fine-tuned lighting.
And remember, you can always mix baked and realtime lights
is this on URP?
Hm weird, when I copy the lightmaps into a folder and bake again, the lightmaps disappear from that folder.
I ran into this too, had to delete the Lighting Data Asset under Baked Lightmap tab to prevent the previous light map files from getting deleted.
@@ericzwirnmann8151 Hey thank you for your reply, I will try that :)
@@mad_man_86 let me know if you got the transition to work, I’m using unity 2023 and can’t get it to switch back and forth. I was close with switching to a dark mode with baked light and back to a light mode without any baked lights but still wasn’t right.
@@ericzwirnmann8151 It works, but the way I do it now is keep the lighting data asset in the scene folder and just copy the images (using the windows explorer) into separate folders. Works great now :)
Would this work with two lights close to each other?
As long as they're baked - then yes. But if you want to disable one of them you have to bake separate lightmap for every possible outcome you want.
@@ClickyDev So.. If I have 16 lights, I've gotta make 65,536 lightmaps? 😂
how does this work with light probes?
I assume you'd have to modify LightmapSettings.lightProbes
where you need to assign new LightProbes variable, which has bakedProbes array that contains all of the scene's baked probes that you need to set
But where are these probe files stored? And how are they assigned?@@ClickyDev
@@S111A111S They are placed by Unity in the Scene folder that is being created by baking the scene lightning.
The filename of them is called ReflectionProbe-n.exr, where n represents the reflection probe number I assume.
I think you should be fine by just dragging that file onto the reflection probe field in the inspector.
does not work for what I need but thanks it's useful info
It doesn't work for me.