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.
Cool thanks! I will update the plugin then.
From what i can tell the colors seem to line up well with these values. Perhaps it can just assume based on the color value? Better than nothing at all imo.
Also there is a light color to RGB value...
Unity - Scripting API: Mathf.CorrelatedColorTemperatureToRGB (unity3d.com)
Also in other news Bakery seems to not like the URP "Simple lit" shader. which i'm using to optimize some scene assets.
Frank, there is a new way to check for the main color and main texture of a material that was added recently:
This gets you the main color and texture either by name or by the new property attributes:
(check [MainColor] and [MainTexture] )
Also, I posted a fix for the preview memory leak on the github issues.
Any idea for this one?
Bakery has to run some C# to apply the lightmaps, because it's the only way (for external lightmaps) since Unity 5: https://support.unity3d.com/hc/en-us/articles/206869046-Using-external-lightmaps-in-Unity-5-0
Not sure how to avoid it except reimplementing ftLightmaps.cs in LUA
Ohh... OK, that should be easy to add then. Will take a look.
Who could've thought. Really nice. I'll add a branch to use this property.
Turns out my shader issue was fixed in a URP update today
Changelog | Universal RP | 7.5.1 (unity3d.com)
Did some benchmarks now with GT1030 vs my old GTX970:
Scene had one directional light with 16 samples and one skylight with 64 samples. One non-directional lightmap with 2048px, default settings.
GTX 970 (1664 CUDA cores): 40s
GT 1030 (384 CUDA cores): 129s
more CUDA cores = more better
A newer graphics card is not always faster than an old one.
You can expect the 70 series to replace the 80 series each generation, but that's all.
(except with the new 30X0 series, where the 3070 replaces the 2080ti )
I am aware of the real-time preview tool, but I remember that during baking the partially baked lightmap would update in scene view (much like the behavior of built-in GPU lightmapper). Perhaps I'm just remembering a different tool.
No, Bakery never did that.
The preview plugin is 50% on sale right now by the way. You should get it, it's really worth it.
Bakery is awesome, all I have to do is click render and the result looks great. Same level of quality you'd expect to be built into a mature game engine.
One question: I've converted my project to HDRP and the real-time preview is slightly darker, I need to slide Exposure up to max. Is there something I need to adjust for HDRP + RTPreview?
Help! I have a big scene and ever since I prematurely cancelled a bake it's now giving me these errors "Argument INDEX OUT OF RANGE"
I already tried reimporting the whole project and regenerating all uv maps.
Enlighten finishes using experimental GI.
Also tried it without the experimental and it still fails to bake. It's definitely on something on the bakery side. HELP! I already tried deleting and reinstalling bakery as well.
EDIT: OH Fixed it. When I cancelled the render there were these weird _ExportTerrain file that remained where my terrain was located at the hierarchy. It was the thing preventing the baking
Sorry for taking your time. And thank you for the nice baking system!
Yes, with built-in lightmappers it's working perfectly. So maybe some setting in Bakery?
I'm afraid that converting decals to meshes is not possible there (but I asked this on their forum). It's strange that with built-in lightmapper it's working perfectly, but with Bakery it doesn't:-( Thanks anyway for your advices.
Hi, Is this possible to only Bake one part of the scene with Bakery? I want to change my multi-scene game to single scene but the problem is, for a single scene, when I hit Render button, it'll bake all objects at once, taking a lot of time. Is there any possible way to just bake one prefab and save it's lightmaps into separate folder and then follow same steps to bake others. I am using Lightmapped Prefabs. I can use different scenes for baking and then spawn prefab through a script but that's kinda time consuming work so I was looking for a workaround. Thanks.
Hi everyone! I hope someone can shed some light on a strange issue I'm having.
The problem happens within a Bakery Lightmapped Prefabs, but it might not have anything to do with it as I think I prefabbed the models originally to try and combat this issue.
When I view Scene A in the editor, lightmaps appear normal. When I build only scene A, the lightmaps appear normal. When I build multiple scenes, then specific models in scene A (from the same .fbx) have scrambled lightmaps. From the scale of the texture, it looks like it might be switching the UV0 and UV1. It could also be that it's referencing the wrong lightmap once it's inside a build. This is happening in multiple scenes and the affected objects are completely unique to each individual scene. In the case of the screenshots, it's the .fbx containing the entire ceiling.
I have no clue and it's incredibly hard to troubleshoot as everything appears normal in the editor. I've tried rebaking the scene, but I won't know whether the broken object is fixed or if another one broke until I've seen it in a build.
Disable UV adjust on the bakery render options and bake again. Check the manual for info.
Thanks for the reply. I assume you mean the UV adjustments that toggling Asset UV Processing enables. I don't use that as it gave too many problems with our multiple scenes and didn't sync properly with our version control.
I did rebake one of the scenes last night. It looks the same in the editor, but as far as I can tell all the objects also look correct in the build this time (as I hoped for). I didn't do anything different from last time bake wise, so I don't know why the lightmap was disconnecting in the build. I'm getting in the habit of making my own Lightmap UVs - maybe that helped the affected objects remain correct in the build. Maybe it was just an abnormal occurrence.
It doesn't ease me though, since if the problem happens again during another bake I won't be able to tell in the editor and won't know until later when I build multiple scenes together. Usually, I can find a forum page of someone having similar issues to me, but not this time so it's likely an isolated case, which means a heap of factors like unity version, graphics driver/card, etc, could all be a factor in my problems. I'd love for it to just be incorrect settings on my part. This particular project is just cursed in general - but it's also the largest project I've been part of using Bakery so that increases the odds of running into problems.
For now, doing extra rebakes seems to do the trick, but if anyone has a clue please share. I dread ever having to rely on Unity's built-in lighting so I'm gathering my own list of good practices when working with Bakery to avoid as many issues as possible.
Can you please implement Unity builtin lightmapper optional behaviour _TransparencyLM as separated alpha for lightmapping. At least basic implementation where white - fully transparent, black - fully opaque. Heavily optimized prepass shaders with separated alpha textures does not work with Bakery well.
Ok, if it's happening in build only, it's surely related to the Player Setting -> Optimize Mesh Data. Disable it completely and build again.
I have heard of many weird stories because of this single setting.
Once you are sure it's because of this, you can try to enable it but disabling the UVs optimization.
I tried with Optimize Mesh Data disabled and sadly that didn't make a difference. I also have stripping level at disabled so my baked prefabs don't go black.
I tried re-baking the scenes. Scene A with the ceiling got fixed. Yay for that. For Scene B however, the first time around it didn't fix the issue. At first I attributed it to bad practice (I'd switched a mesh through the mesh renderer context menu instead of properly replacing it). Once i cleaned that up it baked correctly/displayed correctly in the build. I thought it was all fixed.. That is till I saw that the issue had jumped to the meshes of a different .fbx in the scene instead.
Come Monday I'll see if another rebake sorts it out, and if not I'll replace the affected mesh and rebake again until i find no more problems in my build.
Have you tried completely deleting all Bakery data on all scenes (Bakery - Utilities - Erase Data) and rebaking?
RTPreview's own exposure slider is a simple linear multiplier. The resulting image is gamma-corrected, but there is no built-in tonemapping. With HDRP you have some complex postprocessing being enabled by default, including a specific tonemapping algorithm.
Also if you are using "render in scene view", the image is already clamped/corrected, non-HDR. If you apply Unity's tonemapping on top, it may look darker/brighter. I'm planning to fix this by sending a full HDR image from preview to Unity.
Ouch! It happens sometimes. Will fix!
Given I have no idea how these decals are implemented, not sure I can give any good advice. If Decalicious' author is OK with it, you can send me a little test project to debug it.
Kinda possible, maybe some info here is useful: https://geom.io/bakery/wiki/index.php?title=How_do_I...#How_do_I_lightmap_a_large_world.3F
My guess would be "optimize mesh data" as atomicjoe said. Also possibly shader stripping: https://geom.io/bakery/wiki/index.p...iated_at_runtime_in_a_build_have_no_lightmaps
Not sure what else could do it... How do you bake "specific models"? Do you build asset bundles? How do you load them?
Do all scenes always look good in the editor (so it's not that case when baking scene A breaks scene B in the editor)?
Huh, I didn't even know it existed. Any problem utilizing _MainTex alpha for the same thing?
Yes. I my shaders in _MainTex alpha packed AO, alpha is in separated single channel BC4 texture for performance reasons.
this might be a stupid question and a wrong thread but does anybody know how do i stop a mixed directional light cast shadows on me in interior of buildings?
Also still couldnt get preview to work, got the latest github as u said, here are the lines that it points to now:
no, and it's not an option. It would take too much time to rebake all the scenes and their components in this project. As soon as the last scene is working in the build, it's being delivered to the client.
I looked closer at the mesh that was looking weird in the build. It's the only mesh in its lightmap group (to preserve original UV). So far it's been consistent that it's a whole lightmap group that's affected, so I don't think it's necessarily the .fbx itself anymore. That would also explain why the problem jumped to a mesh that wasn't an issue before if it's not connected to the .fbx but the assigning of lightmap through the lightmap group selected.
I've tried with both "optimize mesh data" toggled off and stripping at none. I've also added the Bakery standard shader to always loaded.
We're not building asset bundles.
All scenes look good in the editor (it's not the UV adjustments wreaking havoc).
The lighting is not baked in the main scene. The interior (an apartment) and exterior (a skyrise view of a city) are two lightmapped prefabs with its content sorted into multiple lightmap groups. Each have a dedicated baking scene. The prefabs are then referenced into the final main scene.
At first, I thought there was something wrong with certain .fbx files, but I'm inclined to believe it's the lightmap group that is getting mixed up in the builds. I have some dedicated lightmap groups for certain props, hence the confusion. It would explain why that when one lightmap group of objects got fixed, the issue jumped to a different lightmap group.
Everything looks just fine in the editor. It also looks fine when I only build the troubled scene. But if I build the entire project with all its scenes, then the troubled scene has its objects from one lightmap group referncing the wrong lightmap, or its lightmap UV is scrambled.
Bakery is awesome!
I got minor issues with skylight rotation.. sry)
When i use cubemap in background, reflection probes .. etc, i got 0° cubemap rotation. But when i use same cubemap with skylight it gives 180° cubemap rotation by default. Not a big deal, but would be cool to synchronise.
Of course these ruin setup for some users, but maybe it can be done when "correct rotation" cheker is on?
Hello! I have a directional light to lightup the whole scene, and a few spot light to lightup the interior. The result is Outdoor scene is okay, but the indoor scene have some bad error as the picture shows. How i fix?
You need more global illumination samples when baking interior spaces. Try 30 instead of 16.
I think i got an answer to this, using shadowmask works very good in URP because of Bakery but been searching the google upside down for the next problem that i encounter now is that i cant get additional lights in my scene to cast shadows, not even spotlights which i read that should in URP. Am i doing something wrong? Anybody else could get shadows in URP for spotlights on dynamic objects?
I’m a bit confused now. Was using Substractive because Shadowmask is not supported by URP. Are you saying Bakery’s doing something special so Shadowmask’s working under URP ?
Sometimes I have a strange issue with baking.
Look at the right chair which looks very different than the left one.
Important is, that we have one mesh here that contains both chairs:
In 3dsmax I started with the left chair (original), doublicated the polys, moved them to the right and rotated them 180 degrees. I do so because of reducing objectcount (if this improves performance is another story).
The same is for the stand of the table.
That "damaged" geometry also produced black spots on the floor.
I´m pretty sure that this is not a Bakery-issue, because the right chair looks a bit darker even before baking.
In 3dsmax I have insured that the normals are all fine.
Yes: Don't use 3dsmax normals. Force rebuild normals and tangents on the model's import tab inside Unity.
You mean "Normals" > "Calculate" ?
Don´t find "Force rebuild normals and tangents"... using Unity 2019.3.8
yup XD i was surprised too. Not sure what happens exactly but my shadowmasked baked sun places a extra shadow inside all buildings and the shadow of the player blends with it when u get in. But now i seem to not be able to get additional lights provide me shadows. Are u able to get shadows from additional lights on dynamic objects in substractive? i tried all ways not only shadowmask, i might be doing something wrong. I mean i get shadows on the player but the player doesnt cast shadows on the floor
Yes. Try both with Calculate and Import and check if it makes any difference.
I'm having a bit of trouble with the Lightmapped Prefabs.
The original building looks great once it's rendered, but when I add the prefab into a scene, it looks like this:
Why does the large model with a Bakery GPU lightmapper on unity 2019.3.0f6 produce black light like this, and the whole model when baked is black?
But after I turned off one model, when using the bakery to bake it again, the light after bake in model was no longer black?
This is the configuration of Bakery Gpu Lightmapper on unity, and graphics card parameters of my computer.
Can you point out the cause for me to fix this baking bug on Bakery Gpu Lightmapper!
is there any chance to have it work in dx12?
What do you mean? Bakery has nothing to do with DirectX. The generated lightmaps will work wherever Unity works: DX11/12, Vulkan, GLES...
the rendering won't start in dx12 with hdrp and instantly crash
Getting error on version 1.71 using Unity 2019.4.10f1 - Denoiser Error: Unknown error (1)
Checked denoiserlog.txt and it says:
Error (1537): A supported NVIDIA GPU could not be found"
I am using GTX 770 with the latest drivers, any ideas?
EDIT: I was able to finish rendering with no issue by using "legacy denoiser"
My team and I are thinking about buying Bakery and we read it was tested on every version from Unity 5.6 to 2019.3.4 but we're wondering if it works correctly on 2020.1.3f1. Did anyone test it on this version? Did you bump into any major issue?
Many thanks in advance!
OK, added. Try latest github version. New logic is:
* If "_TransparencyLM" is present in the material and set to a non-null texture
* Its red channel is used instead of main texture's alpha
Everything else (cutoff value, RenderType check) works the same.
Do you want to exclude interiors from being lit by a mixed light? You can
- Use the culling mask on the light
- Put some "shadow only" blocker objects inside windows
You are not using the latest patched version, it's different now (even at the time of your post).
Lightmap groups don't have runtime logic on their own - they are only used to instruct the lightmapper to bake them in a certain way. Baked lightmap data is stored identically for grouped and non-grouped objects, inside an invisible "!ftraceLightmaps" object. If you have a Lightmapped Prefab, the same data will be stored on a visible BakeryPrefabLightmapData object.
Maybe it's something about nested prefabs? They weren't thoroughly tested and they make everything complicated.
Yes, 180 degrees flip is a bug from older times, "correct rotation" checkbox should do the trick.
This noise looks too annoying to be simply a lack of GI samples. Check if:
- Interior wall normals are adequate (not smoothed out). You can check if enabling "calculate normals" on the asset makes any difference.
- Wall UVs are also adequate. Are you using "generate lightmap UVs"?
- Any small, bright, emissive object? Does this lamp emit light itself (why do you use a spotlight then?). Check if using non-emissive material solves the problem. Unity also supports separating baked/realtime emission, at least in the standard shader.
Sounds like broken normals?
I use 3dsmax normals all the time, but I recommend Reset XForming any geometry before exporting.
In fact I have my own dumb "reset xform 2.0" script I run on everything (it doesn't flip faces unlike the built-in):
for obj in selection do
s = obj.name
b = box()
b.pos = obj.pos
b = convertToPoly b
b.attach obj b
b.name = s
polyOp.deleteFaces b #(1,2,3,4,5,6)
AFAIK, subtractive only works with one "main directional light".
Can you show me your lightmapped prefab component in the original baking scene? Are there any warnings written on it?
No UVs? (see bold): https://geom.io/bakery/wiki/index.php?title=Manual#Quickstart
No Bakery light components?
There is, but it's complicated. I'll patch it eventually if more people start using it. Also I'm still on Win7... ouch
Bakery uses DX11 API to exchange texture data during the scene export, so currently editor must be in DX11 mode.
Hmmm, quite surprising, I'd expect it to work. Are you sure these were the latest drivers? Good to know legacy one is still working.
Currently tested on 2020.1.2, but not 1.3 yet. I doubt there is any serious problem and I'll have to fix it ASAP if there's any.
for obj in selection do
s = obj.name
b = box()
b.pos = obj.pos
b = convertToPoly b
b.attach obj b
b.name = s
polyOp.deleteFaces b #(1,2,3,4,5,6)
Oh, so that's why...
Many thanks! Will check it a bit later.
The column of the table gets illuminated by the sun and the lamp above, but how can this shadow be?
How do you expect it to look? How does it look with realtime lights? You have lamp lighting being shadowed by the table, but sun lighting still visible at the spot, thus illuminating the area. Probably something like this:
Shadow penumbra (shadow spread) is also playing a role here, as shadows become blurrier with distance.
You´re right, it´s just looking unreal here - sorry!