A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by guycalledfrank, Jun 14, 2018.
How would I setup network baking?
Does it mean it supports GPUs of machines in the LAN?
[UPDATE] I upgraded my lightmap saver script to keep track of mesh renderers also, by storing a serialized dictionary of instanceIDs and the lightmap index and scale in lightmap. So now you can bake in multiple scenes on multiple PCs and bring all snapshots into your main scene and swap between them (also at runtime). Check the descriptions.
I've made a github gist and will keep it up to date as I use it: https://gist.github.com/tdbe/e3c41e6a2dedd88dad907218126a2c39
Has anyone occurred these errors?
After testing for a few hours, we was able to reproduce the errors if we put plenty of spotlights. (100~200)
Still don't know how to solve the problems.
Does it happen even on example scenes? Basically the question is: is the problem related to the scene or to the way your light is set up? What does the first window say?
Not sure why that would happen. You can switch to L1 probes for now (experimental settings -> Light Probe mode).
... and do you have Bakery light components on the same gameobject?... Maybe experiment a bit with lighting on a simple scene.
With mixed lighting you will need both components present. It's all in the docs.
Thanks! I'm sure it will be useful for many people
Switch to L1 probes seems to work like a charm.
It only shows an error: Can't load UVGBuffer tangent after the last probe has been baked.
(Since it is experimental?)
Anyway L1 probes seems to work now.
About the 1st problem, example scenes work great.
Our scene use a lot of lights, every light has attached corresponding Bakery Light script on it.
Is the problem relative to number of lights?
And the first image told merely a crash report from Microsoft.
[ ftrace.exe has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
Hmm that shouldn't happen. Can you send me your .ftracelog.txt? (assets/editor/x64/bakery)
Unlikely. Log file would help to diagnoze it better.
Also, if you can, send me pointlight.bin file that's located in your temp folder after the crash (default path is Users/You/AppData/Local/Temp/frender)
Okay, here it is.
Can't open C:\Users\sos\AppData\Local\Temp\frender\uvtangent_probes.lz4
Looks like the problem is here.
Probes: it seems like somehow you have an experimental "Tangent-space SH" option enabled on the skylight. I suggest turning it off (it's not useful for lightmaps and was added to bake SH occlusion for dynamic objects using a special shader... will document it some day).
The other error: can't find it in the log (too large, and seems like you had a bunch of successful bakes since then). Can you resend it again just after it happens?
Thanks, disable Tangent-space SH works!
I will test the other error asap.
Hi Frank I have a question about output file, i did a search and found your cmt about this.. I'm working on project that being build for iOS, I usually use standard plus shader with 8bit .tga format for lightmaps (generated by vray ) because anywhen i use 32 bit files - the lightmaps always have strange aura on it.. I don't know why .. is it because GLES 2.0 ? how could I customize bakery's output format in this situation
Nice to have a little helpdoc here but it´s still confusing to me (sorry for being stupid):
I assume this basic setup (for me and most other users):
Unity-Developer works on a machine with NVidia-Card, Unity + BakeryPlugin installed.
This is the server.
What exactly else does the server need (ftServer.exe)?
In the LAN there are some other machines, called clients.
What exactly do these clients need as minimum hardware and software?
(It would be cool if we could place some piece of software in the autostart of the clients, so that there is no need to launch the clients by hand.)
I bet the "strange aura" is the result of reading RGBM-encoded HDR lightmap as regular color texture. You should use
Unity's own DecodeLightmap() function or just decode it yourself:
float4 lightmapEncoded = tex2D(unity_Lightmap, lightmapUV);
float3 lightmapColor = lightmapEncoded.rgb * lightmapEncoded.a * 5; // exact code may vary per platform... check UnityCG.cginc source
You can also just convert the HDR lightmap into a regular texture in e.g. Photoshop: Image->Mode->8 bits->Exposure and Gamma -> OK -> Save as as TGA. Photoshop can batch process multiple files.
This Unity developer probably won't be happy with his machine fully loaded with someone else's baking
My intended use was to work on one PC (client) while baking on another PC (server), so I can continue e.g. scripting or level design without interruptions.
Server only needs the Assets/Editor/x64/Bakery folder. Scripts are unnecessary, but all exe/dll/ptx/vso/pso/gso files are. You then launch ftServer. It will listen to remote commands and execute them.
Clients need a full Bakery installation. Clients are supposed to be actively working in the editor, while server is dedicated to baking.
float4 lightmapEncoded = tex2D(unity_Lightmap, lightmapUV);
float3 lightmapColor = lightmapEncoded.rgb * lightmapEncoded.a * 5; // exact code may vary per platform... check UnityCG.cginc source
ok, well here's my problem then. i have mixed lighting. I want some of my objects to have baked shadows because they are static objects and I want my fps to improve. if I have both components on, the dynamic shadow will be drawn on everything. so, I have 2 shadows on those objects. it seems to me that in this case, there is no purpose to using baked lights at all.
I've setup Bakery in a project, but am not yet ready to bake lighting - the scene is incredibly large and complex and needs some processing before it's ready. Unfortunately, Bakery keeps automatically toggling on "Baked Global Illumination" in the Lighting settings for the scene, no matter how many times I turn it off.
While that setting is enabled (even with no baked lightmaps and all data cleared), Unity begins lagging horrendously (as mentioned, scene isn't ready for baking - this isn't Bakery's fault, even without it installed Unity lags with it enabled, but normally we can uncheck it and leave it that way).
Is there any way to temporarily stop Bakery from enabling Baked Global Illumination every time we load Unity, or is the best solution just to uninstall Bakery for now? I've taken a brief look through the source code and can't find where it toggles the setting, but I'm happy to edit the code/comment something out myself if I know where to look.
bakery does not have a toggle for "Baked Global Illumination" they have "Render button" and Unity toggle is "Auto Generate"
what version of Unity are you using ? something is not correct
Sorry but I have to ask some very noob questions and I hope you can help;
1) What is the actual reason for Bakery including the light objects, such as point, spot, etc? I mean, unity has them already. So is this an optional alternative to unity? If so, what reasons would I choose the option? OR, is it what I have to use if I'm to use Bakery?
EDIT: OK looking at the manual again, I see right up the top it says to add the direct light script to the default unity directional light in the scene. So it's like an extension, not a whole light in itself?
Edit2: I think I get it now. So the unity lights are real time, but you piggy back on the Bakery light components so get baked static lighting. Right?
2) I clicked create spot and also point and positioned them on the scene; but nothing happened. Are they real time? Am I not meant to see what they do in the editor? Please point me in the right direction for this.
I think this is answered by the above. Or maybe not fully. If you don't want the light to realtime, do you still need to use a unity light (set to baked) + bakery light component? Or just bakery light component?
3) I have regular unity light objects in the scene, and I did Render in bakery. Looking around in the editor and play in the editor looked a certain way, but then when I did an actual build the same scene looks different. It had a whole area lit up that was totally dark for example. Another weird example is a whole patch of floor in this fairly lit up area was totally black and unlit. Just sitting like an inexplicable patch of dark.
So again, anyone way to point me in the right direction here? Could it be to do with any light data that the regular unity made and isn't cleared or something?
Never mind for this one. It sorted out one way or another. Something between clearing the Unity lightmap, putting the bakery components in, and doing a new Bakery render.
4) Actually one more question while I'm at it; What am I meant to do with the regular unity Light settings? Ignore them? Set them a certain way to get them out of the way? Combine them with bakery in some way?
I'm still wondering about this, but think you pretty much just ignore it? I mean like if real time GI and auto-baking are disabled in the lighting setting, it won't really do anything because I'm not clicking bake for it?
Can you make bakery bake lighting to a skeletal static object? I want to bake a basic skylight lighting to my character then uncheck the static box n then aninate it.. and add real time lights on him to acccentuate some more. Is this possible to do so? Or if I did bring in a copy of the character in obj format and baked lights on him, can I copy tge baked light map and apply it to my skeletal charcter like an ao pass?
bake mode : substractive
the bake works fine, static shadows are baked, dynamic objects have dynamic shadow,
but if i add a new object after the bake is done, it doesn't have any shadow at all
it doesn't matter if i rebake the whole scene, or delete all lightmap data and rebake, the new objects simply has no shadow (dynamic object, should have realtime shadow)
2018.3, but all earlier version have the toggle as well. I can't speak to 2019.
Bakery toggles this on every time Unity restarts.
EDIT: To clarify, this is *NOT* the lightmap auto generating, there is no baking going on whatsoever. Even when no baking is occuring, just having this toggle on causes significant lag. As to why that is, I'm *assuming* it's because we're working with such a large scene, but I honestly don't know, need to investigate further (also accepting suggestions on that front, but wasn't the purpose of the post ).
Bakery toggles this on every time Unity restarts..[/QUOTE]
interesting I understand now , I have know idea why this would cause lag also
looks like this is bakery and not xatlas .. it may have always been this way even pre version 1.5 .. looks like it happens after gamma is changed to linear detection … I assume it must be some place in the dll[/QUOTE]
This is the trace log of the other error.
Unfortunately it seems there is no error message in it.
The Win7 PC still can't finish baking and fail.
Does Bakery use some special features and we need to update Win7(or install some runtime packages)?
Use shadowmask mode with lights having Baked Contribution = Indirect and Shadowmask. You'll get static shadows and GI baked, only shadows from dynamic objects will be updated every frame.
My bad. I assumed the flag is needed for the engine to use baked lightmaps, but apparently it's some kind of a very specific Enlighten option (??). Docs aren't very clear on that.
I disabled it for now and will see if it breaks anything. You can do it yourself as well: open ftLightmaps.cs, find "Lightmapping.bakedGI = true", remove it.
Yeah. Bakery lights affect baked lighting only. And since they have more/different options comparing to Unity lights, they are kept separate.
Just Bakery component is enough.
Unity global lighting settings don't do anything (the only exception is when using Subtractive lighting, then you can specify shadow color there as usual).
Currently not. You can sort of do it by importing a non-skeletal copy of the same model with identical UVs, baking it and then using the map on the real one. Use a lightmap group with Original UV mode. You can also just use xNormal, Substance designer, etc for that (put a ground plane and bake wide AO).
Check if it works with built-in lightmappers. Unity does not expose any API regarding which objects cast shadows in subtractive mode (should be all dynamic objects normally), I don't have any control over it, must be engine-related.
Weird. No special packages are required (and if they were, if would manifest itself earlier). Interestingly, I also never saw the kind of Windows error you have on the screenshot.
I'm not sure if it'll make any difference, but try removing "#define LAUNCH_VIA_DLL" from ftRenderLightmap.cs and ftBuildLights.cs and see if it helps.
Given there is nothing in the log, it feels like the error is somehow related to the process launching, not the baking itself.
I just tried this. the baked shadows only appear if I disable shadows on my light.
with shadows enabled, all the shadows are dynamic. with shadows disabled, the bakery shadow shows up but no shadows on dynamic objects.
You should write this into the docs wiki. Say that RTX is only supported on 20xx series Nvidia GPUs and on older videocards it is only emulated and may actually be slower.
Make sure you don't have "distance shadowmask" option enabled.
I heavily appreciate the idea to continue working on scripts etc. without interruptions.
Do you plan to include only one additional machine in the LAN or even multiple?
I believe the common server-client setup means that a central server (the Unity-Dev works on) serves data to clients which operate on this data and send back the result - right? At least this is what VRay does.
(In your help you use the words Server/Client vice versa which confuses me.)
Thank you!! Very much appreciated. This makes things much easier.
I had actually assumed the flag was needed as well - we're just not quite ready to actually use baked lighting yet, and figured we'd manually toggle it on when it was time to build.
haha, you know that is odd because I just found that option in my quality settings and was noticing that it was helping.
now I've noticed it in bakery options and it is absolutely doing the job. of course it is.
thank you for your patience.
lol so all we just need now is the address for franks server perfecto
okay, now I have it all set up and that all seems fine, but now I am finding that my dynamic objects are not receiving real time shadows from my static objects.
I've tried changing my mixed lighting settings in my unity lighting window and the following results :
subtractive - I get baked shadows and realtime shadows together.
shadowmask - no realtime shadows from static objects on dynamic objects
baked indirect - same as subtractive
I'm really not doing well with this am I ? XD
I'm attempting to bake a large scene in sections using Lightmap Groups (baking the whole scene at once ends with an out-of-memory error). Before I set up the groups, with everything hidden except one area of the map, that section bakes beautifully. After setting up groups, however, I get an error about "multiple LOD levels" not being supported, and no matter how much I click "Continue anyway", it won't bake. Why did adding the Lightmap Group Selector introduce this error, and is there a workaround for this?
just a tip fully baked LODs can cause more atlases to be generated, because the different LOD levels can't share the same atlas.. by baking the LODs you are generating a lot of extra used memory and a lot of extra lightmaps .. may I suggest you try only baking LOD0 and use light probes on LOD1+
this is also what Unity suggests as a best practice even with the standard light mappers
also see https://forum.unity.com/search/member?user_id=275716
Hi Frank. I recently updated Unity to 2019.1.6f1 (No Hdrp) and the Area light doesn't seems to be working. I have attached the screenshot with Unity progressive CPU and Bakery and for some reasons, Area lights are not baking at all.
With Progressive cpu
For now there is only one server, because some tasks (GI) are sequential and not trivial to parallelize.
Also I only have 2 PCs, so that makes it harder to test
Well that kinda still holds true. Multiple client machines can use the same server to bake lightmaps and get the result back.
Nah, you should run your own instance. You can't know my address, it's not a public IP
I'll add that what the docs actually mean is occlusion probes. They store shadowing information on top of color per-probe.
No easy workaround currently. LMGroups can't contain renderers with multiple LOD levels. I suggest either of these 2 options:
a) Bake in separate scenes, then combine via LoadLevel.
b) Create Lightmapped Prefabs out of every separate level part and bake them.
Didn't check this particular minor version, but seems to be working on 2019.13f1:
Anything different about your light settings?
guycalledfrank, you are a legend. I realise you are not responsible for my poor knowledge of unity lighting systems and how these are separate from bakery, you are so helpful and I appreciate it so much.
Yes, I was using Bakery point light component instead of Light mesh. Worked perfectly fine.[/QUOTE]
Also, I noted the below error while baking the lighting in lightmap tab. It appears after baking the lights with bakery. Should it be ignored?
Yes. Shouldn't affect anything.
guycalledfrank, can you please clarify at which state is the speedtree support currently? My problem is that I have couple of plants with SpeedTree shader applied in my interior scene. It works great in Editor and in VR at runtime, but after making a build all those plants turn black. Is it a known issue? I can provide some screenshots or other data if it's needed. Thanks!
I got a tip for anyone using unity terrain and unity trees,
I took screen captures of my trees and mapped them onto billboard meshes and temporarily replaced all my trees with this billboard and baked the shadows with those before changing them back.
The important part of this is that the billboard must be a single mesh and must be the base level of a prefab. Otherwise unity terrain won't display it. I made the billboard mesh in max. It also has to be the correct size, because unity terrain removes any transform data.
In my case it's not terrain trees. It's several objects from asset library with Speedtree shaders applied. And it's interior scene where I need to have lighmapping in it's whole beauty which is working great until I build the project.
Yes I was initially going to reply to you directly when I saw you mention trees, but I realised its a different situation. I'm sorry I don't have any information about how to solve your issue. It depends what your trees are like stylistically, there are possibly some workarounds you could do. For my own trees, I found that ambient occlusion made them look nice enough and I didn't need to have baked shadows on them.
It's cool, thanks
Sounds like a great workaround. But the thing is I already have great looking interior plants baked with Bakery. It all breaks into dark objects only when run under a built project. From Editor and @RunTime in Unity it works absolutely flawless. My guess is that it's a SpeedTree shader that makes problem @ build time not being able to work with Bakery lightmaps or something like that.
that sounds like a similar problem to the issue I had with my fences. in my case, my fences would be invisible in build. it was something to do with the autofence addon building fence meshes at build time. I resolved this by converting my fences to meshes manually and then baking. I don't know if this is at all similar, but it could be the result of something 'generating' at build time.
I am super excited by the network rendering, this is because I primarily work on macOS. I gave it a shot today, and it appears there is some sort of UI library preventing it from kicking off.
I would very much love to use Bakery in this setup. It connects to the server and shows it's idle properly. And does not throw any errors in doing so. I also was able to do all the things the Quick Start says to do. But once I click Render it throws the error shown below.
Is there anything I can do to help test/debug this? I did some skimming of the thread, I am on the 64bit version of Unity. I verified the simpleProgressBar.dll exsists in Editor/x64/Bakery.
I'm also using unity 2017.4.15f1 right now. LTS.
ftRenderLightmap.ProgressBarEnd (Boolean freeAreas) (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:855)
ftRenderLightmap.TestSystemSpecs () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:362)
ftRenderLightmap.RenderButton () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:786)
ftRenderLightmap.OnGUI () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1556)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)
I keep on getting this pixelation in my android build environment scene. I feel like the point light is causing the problem. Can you guys help me out what would be the proper settings for my point light?
I'm using Unity 2018.3.4f1 and the latest Bakery.
100 texel per unit in Dominant lighting setup.
I still haven't properly tested SpeedTrees, but AFAIK, they don't even have valid lightmapping UVs (?). Probably just light them with light probes?
A clever trick!
OK probably they do have UVs? I wonder if disabling batching (the static batching checkbox on the plants) will change anything?
Yeah unfortunately you still need Win even for the client machine, because much of the scene preparation/export logic is done in DLLs using WinAPI/D3D11. The progressbar error you encounter is just a tip of the iceberg. There is a lot of helper functions I have in DLLs related to texture export/conversion/transformation that are called directly from Unity and cannot be offloaded to the server. Fixing it is possible, but not too easy, and I don't have a Mac to test (and any experience building anything for a Mac).
Hi! Seems like a popular question, added it to the docs now: https://geom.io/bakery/wiki/index.p...id_project.2C_and_lightmaps_don.27t_look_good
the Fontainebleau Demo has been updated to
to Unity 2019.1.3f1 HDRP 5.16.0
Think it could be an great advanced Bakery TestBed.
Would it be possible to update the Bakery HDRP from 5.13.0 to 5.16.0?
Directional Light has plausibel Lux now.
Day 110 000
Sunset 30 000
* most of rocks use HDRP Lit
* some HDRP Layered Lit.
* trees HDRP Samples Wind ShaderGraph
* Unity Terrain is now used
* has 3 different lighting subscenes, Night, Sunset, Day
I am finding that I have to disable a load of my lights because i'm getting an error that says i can't have more than 4 lights overlapping....
I read about this on unity wiki
The way I understand it is, bakery is limited to rendering 4 light sources per texel because it uses GPU baking. is there a way to add additional passes and layer the baked shadows, and then merge them just like how photoshop does?
The limitation is not because of the baking, but because:
- Runtime Unity shaders only support 4 masks.
- You can fit 4 masks in 4 channels of a single texture (RGBA).
Shadowmask is not just an image you can get in photoshop, but an array of masks per-light. Every real-time Unity light is using its own layer to occlude itself.
You should either:
- Limit light radius to reduce overlaps.
- Make less important lights fully baked (no shadowmask).
- Use bitmask/LMGroups to filter lights per-group (i.e. even if lights overlap but belong to different rooms, it can be fine).