Difference between revisions of "How do I..."
(→How do I add fake ambient lighting?) |
(→How can I trigger a bake via scripting?) |
||
Line 31: | Line 31: | ||
Check out [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] ("Original UV" mode). | Check out [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] ("Original UV" mode). | ||
− | === How | + | === How do I trigger a bake via scripting? === |
There are 3 steps involved: | There are 3 steps involved: | ||
Revision as of 15:40, 2 June 2019
Contents
- 1 How do I make a lightmapped prefab?
- 2 How do I use git/collab/other version control system with Bakery?
- 3 How do I share a scene with someone who doesn’t have Bakery installed?
- 4 How do I bake using my own UVs without any alterations to them?
- 5 How do I trigger a bake via scripting?
- 6 How do I add fake ambient lighting?
How do I make a lightmapped prefab?
See Lightmapped Prefab component.
How do I use git/collab/other version control system with Bakery?
First, make sure all machines have the same version of Unity and Bakery.
Unity 2017.1 or newer:
You should commit:
- Any updated assets unrelated to Bakery.
- All updated *.meta files.
- Lightmap textures.
You should not commit:
- Bakery folders.
Pre-2017.1 versions of Unity:
- Also commit ftGlobalStorage.asset.
If UVs don't look right, right click affected models and click Reimport.
Apart from the scene and its lightmaps you also have to include a few scripts, namely:
- ftLightmaps.cs
- ftLightmapsStorage.cs
- ftLocalStorage.cs
- ftGlobalStorage.cs
- ftModelPostProcessor.cs
How do I bake using my own UVs without any alterations to them?
Check out Lightmap Groups ("Original UV" mode).
How do I trigger a bake via scripting?
There are 3 steps involved:
1. Get the render settings object:
2. Modify the settings. Full list can be seen in ftLightmapsStorage.cs. As an example, here is how you can limit the amount of bounces and set the output folder:
3. Create Bakery instance, load the settings and bake:
How do I add fake ambient lighting?
In some non-realistic scenes you may want to add a fake ambient factor that doesn't come from natural GI or sky lighting (i.e. a cave that would be pitch black in reality, but has to be visible in a game).
Bakery doesn't have a built-in fake ambient option, but you can emulate it with 6 shadow-less directional lights:
1. Create 6 axis-aligned Direct Lights.
2. Set their Shadow Samples to 0.
3. Set their colors to desired ambient colors (you can use different top/bottom/side lighting if needed).