Yes, we are using Unity’s version control Plastic. What I did notice was once I refreshed the Temp path: directory folder under Output options the error went away. Just wondering if this is correct? I’m just trying to make sure this is correct before we try to upgrade Bakery from our current unity version which is 2021.3.15. We are currently using the asset store Bakery version and the current GitHub version fixes a lot of our current light bakes problem areas.
If you had the temp folder under Plastic, inside the project folder, it could be the reason. Generally the temp folder is for large temporary data, you definitely don’t need to version-control it.
Which ones, by the way?
We’re creating all of our levels with modular pieces for walls, floors ceilings etc and we get that light bleeding highlighting/darkening whenever on some areas due to floating point on xyz numbers when we snap pieces together. I noticed the latest github bakery version can fix this and make things look way more buttery smooth on this. At first, I thought it was the AO causing this in the bakes but even turning off AO in the bakes does not fix these types of problems on the Unity asset store bakery version.
Well, I understand the situation, thanks for the explanation. I use Magic Light Probe to place lightprobes. The current settings are as follows:
We are developing a car racing game. When the light probe is insufficient in the scene, the car becomes dark-bright, there is no proper light, and there are flickers. It becomes a little more stable with these settings, there are a total of 200 thousand light probes in 6 maps. We have a slightly large map for a mobile game. I try to optimize when possible. After placing the MLP, I manually delete the unnecessary ones.
@guycalledfrank Hi there ! I would like to make a feature request if you ever find the time for it :
An option to choose a color for baked shadows. I had my artists ask me for something like that for forever, especially for stylized art styles.
It’s possible to bake shadowmask and then use them as a mask to color the shadows in the “normal” lightmaps but it would be much more convenient if i could just choose a color for the scene (or even per Lightmap Group) and have it work automatically. Since i develop for mobile VR, i also usually want to use fully baked lightmapping modes and not have the build size balloon from shadowmask that i don’t need.
I tried placing all kinds of ambient lights and the six axis directional light workflow in the wiki but it’s very work intensive and the effect just isn’t that great because it adds more light to the mix and is hard to control.
I know you have a lot of on your plate, but from my outside perspective it seems like you already got most of them ingredients done to make this a possibility. Anyways keep up the good work and enjoy some potatoes
PS: The MonoSH directional mode is an absolute godsend, i am using it for every new project now!
Hello all, I’m having a bit of a problem in my Unity 20022.3.12f1, URP project. When I go to render I get a series of error messages. The first “Terrains are not implemented in RTX mode.” The second “Error (1281): Invalid value” and the last “ftraceRTXerror: Unknown error. See .ftracelog.txt for details. (1) Possibly incomptabile RTX mode? Try running Bakery → Utilities → Detect optimal settings.”
So here’s the .ftracelog.txt below. Also, I’ve already run “detect optimal settings” and selected “set recommended as default”, which did not solve the issue.
Thank you so much and please let me know if there’s any additional information I can share that can help us solve this issue!
Best,
yamm
Init...
sun
Loading geometry...
Loading alphas...
Tile size: 512
Device 0: NVIDIA GeForce RTX 3080 Ti (ON)
Used host memory: 0mb, available GPU memory: 11066mb
MODE: sun
USING HALF
Load shaders...
Loading shader lmSun.ptx::oxMain...
Loading shader clip_rtx.ptx::oxMain...
Loading shader shadow_rtx.ptx::oxMain...
Loading shader miss.ptx::oxMain...
Loading shader attrib_trimesh.ptx::interpolate...
Used host memory: 0mb, available GPU memory: 11066mb
Used host memory: 0mb, available GPU memory: 11066mb
Create buffer...
Num passes: 4
Num tex: 4
Skipping pass LDR
Pass light_HDR...
Skipping pass Mask
Skipping pass Dir
Used host memory: 0mb, available GPU memory: 11066mb
Launch 1x1 tiles...
Tile 0x0...
Streaming...0
npHD
Launching...
Used host memory: 0mb, available GPU memory: 10970mb
-----
Mem stats:
Total: 96
Alphas: 0
GI albedos: 0
GI lightmaps: 0
Light data: 0
Output: 0
UV GBuffer: 0
Scene: 12383
-----
Render time: 0.256 sec
Writing...
light_HDR.lz4
Done
Init...
Error (-1): Unknown error (Details: Function "_rtBufferCreate" caught exception: Assertion failed: "rtcRes == RTC_SUCCESS", file: C:\u\workspace\rel5.0-win64-cuda90-VS2015-build-Release\sw\wsapps\raytracing\rtsdk\rel5.0\src\Device\CUDADevice.cpp, line: 180)
sun
Loading geometry...
Error (-1): Unknown error (Details: Function "_rtBufferCreate" caught exception: Assertion failed: "rtcRes == RTC_SUCCESS", file: C:\u\workspace\rel5.0-win64-cuda90-VS2015-build-Release\sw\wsapps\raytracing\rtsdk\rel5.0\src\Device\CUDADevice.cpp, line: 180)
Init...
fixpos12
Loading geometry...
Error (1281): Invalid value
Init...
sun
Loading geometry...
Loading alphas...
Tile size: 512
Device 0: NVIDIA GeForce RTX 3080 Ti (ON)
Used host memory: 0mb, available GPU memory: 11066mb
MODE: sun
USING HALF
Load shaders...
Loading shader lmSun.ptx::oxMain...
Loading shader clip_rtx.ptx::oxMain...
Loading shader shadow_rtx.ptx::oxMain...
Loading shader miss.ptx::oxMain...
Loading shader attrib_trimesh.ptx::interpolate...
Used host memory: 0mb, available GPU memory: 11066mb
Used host memory: 0mb, available GPU memory: 11066mb
Create buffer...
Num passes: 4
Num tex: 4
Skipping pass LDR
Pass light_HDR...
Skipping pass Mask
Skipping pass Dir
Used host memory: 0mb, available GPU memory: 11066mb
Launch 1x1 tiles...
Tile 0x0...
Streaming...0
npHD
Launching...
Used host memory: 0mb, available GPU memory: 10970mb
-----
Mem stats:
Total: 96
Alphas: 0
GI albedos: 0
GI lightmaps: 0
Light data: 0
Output: 0
UV GBuffer: 0
Scene: 12383
-----
Render time: 0.024 sec
Writing...
light_HDR.lz4
Done
Init...
Error (-1): Unknown error (Details: Function "_rtBufferCreate" caught exception: Assertion failed: "rtcRes == RTC_SUCCESS", file: C:\u\workspace\rel5.0-win64-cuda90-VS2015-build-Release\sw\wsapps\raytracing\rtsdk\rel5.0\src\Device\CUDADevice.cpp, line: 180)
sun
Loading geometry...
Error (-1): Unknown error (Details: Function "_rtBufferCreate" caught exception: Assertion failed: "rtcRes == RTC_SUCCESS", file: C:\u\workspace\rel5.0-win64-cuda90-VS2015-build-Release\sw\wsapps\raytracing\rtsdk\rel5.0\src\Device\CUDADevice.cpp, line: 180)
Init...
fixpos12
Loading geometry...
Error (1281): Invalid value
Init...
fixpos12
Loading geometry...
Error (1281): Invalid value
Init...
fixpos12
Loading geometry...
Error (1281): Invalid value
APV update is coming soon…
Meanwhile, if you ever tried using Bakery in an ECS project and had problems with that, I’ve just added some ECS-supporting code. The main problem with Unity’s Entity rendering system is that they decided to convert all scene lightmaps to a single global Texture2DArray, meaning that they all must be of the same size and (for some reason) have a full mipmap chain. I’ve added a script that runs early during ECS “baking” validating and correcting lightmaps for the ECS renderer.
Got you.
My code assumes a single global LightProbes object, because it was the only usable assumption before Tetrahedralize() was introduced… it’s gonna be really hard to change it everywhere.
Instead it’s easier to make a script that would split the probes to different scenes after baking.
I can try it this week, so maybe reply to this post, just in case, so I’ll keep seeing it
Shadow doesn’t have a color technically. It’s just an absense of light. If you want e.g. a “blue shadow” you just need to add a blue Skylight, for example, that would fill shadowed areas.
Contribution of all lights is added together (imagine showering your scene with photons from different sources). “Colored shadow” can only make sense for semi-transparent objects (e.g. stained glass) which filter certain wavelengths, but it can’t be a property of the light itself, because it would mean that simply creating the light, without it even reaching any surface, would make the whole scene emit its “shadow color”. I can’t see any reasonable algorithm to add multiple of such lights together.
Do you have a reference picture of the look you’re going after? I’m sure it can be achieved differently.
Hmm it shouldn’t be very work-intensive - you can just copy the same 6-light prefab from one scene to another, and you can edit them all at once. Since all lights are baked, their amount doesn’t reflect on runtime.
If that doesn’t look the way you want it, maybe try some custom post-processing on the lightmaps?
You can:
- Subscribe to OnFinishedFullRender;
- Get the lightmap data storage (ftRenderLightmap.FindRenderSettingsStorage());
- Get the lightmap list (storage.maps);
- Create a RenderTexture with ARGBFloat format;
- Use Graphics.Blit with your custom post-processing shader from maps[i] to the render texture;
- Create a Texture2D with RGBAFloat format;
- ReadPixels the RenderTexture into the Texture2D;
- Use EditorUtility.CompressTexture to compress the new texture;
- Save the new texture as an asset;
- Replace maps[i] with the new texture.
Maybe I should make some example script and then you (and others) can just tweak the shader function?
Thank you, working on it! It’s annoying to peel them though
Yay!
Oh. It happens if you have “Terrain optimization” and “RTX mode” enabled at the same time. Normally it shouldn’t happen. Not sure how you got that… I suspect the “Set recommended by default” might be not turning the Terrain checkbox off…
…turns out it was the case. Fixed it.
Terrain Optimization is a special heightfield tracing code I added before RTX cards were a thing. It wasn’t faster, but it did save memory, when baking. With modern RTX GPUs it’s more optimal to trace everything as triangles, using RT cores, and they have more VRAM to allow it.
Thank you Frank!!!
Yeah that kind of postprocessing was what i was after. Thanks for pointing me into the right direction, that actually helps a lot
Also get one of those and then you can peel the potatoe easily in one big strip, very satisfying ^^
Glad to be able to help you out for once.
Hello, i’m fixed Lightmap Swapper & Light Probe Storage
extension from Community extensions - Bakery GPU Lightmapper: Wiki
Previously script SS_LightProbeStorage.cs
will not work if you have multiple scenes, cause method ApplyHarmonics()
works incorrect, in cycle shs
has i
index but must have id
index.
if (id > -1) {
for (var r = 0; r < 9; r++) shs[id][0, r] = harmonics[i].c1[r] * harmonicsMul;
for (var g = 0; g < 9; g++) shs[id][1, g] = harmonics[i].c2[g] * harmonicsMul;
for (var b = 0; b < 9; b++) shs[id][2, b] = harmonics[i].c3[b] * harmonicsMul;
} else {
Debug.LogWarning("Can't find baked probe #" + i);
}
I will be glad if you accept these changes and mention my github or nickname pysijuice
on your forum near this script.
I just started getting this error after upgrading to the latest Bakery on GitHub. What I noticed is levels that only have 1 lightmap I don’t see any errors but on levels that have 2 lightmaps in the level I get that error in the screenshot.
I also upgraded to the latest driver. I have an Nvidia GeForce RTX 3080. Thinking it was the upgrade to the latest drivers and I rolled it back to the original driver update but I am still getting the same error. Any help would be great.
Thanks for the fix! I updated the page with the corrected package and your mention
Was it fine before the patch? Did you have the latest Asset Store version before it or an older github patch?
Thanks, I can’t remember ever seeing those before Truly high tech. Gotta find one…
...
I actually spent quite some time trying to find a fully automatic solution for this back in 2021, but all machines I could find had ridiculous prices and were of ridiculous sizes, not something to use at home.
Summary
Someone has to make a decent home potato peeling machine… POTATORY CONFIRMED??
Yes, I was currently using the asset store Bakery version and everything was fine in that version. I could bake any scene with as many lightmaps needed with no errors. This new error only showed up after I upgraded to the latest Bakery on GitHub. Also I’m using unity version 2021.3.15 in URP.
Can’t repro it on my scenes… can you get this bug on a simple scene (with > 1 lightmaps)? Perhaps there are other ingredients to cause it?
Good morning!
It would seem I am getting an error with RTPreview.
I have my scene setup. It has light meshes and point lights.
When I am in preview mode and I change any values that would effect the lightmaps, the light meshes changes to a bright yellow. Those yellow changes are not reflected in the values in the Inspector. Just the meshes are turned yellow and I have to close out Preview mode and reopen it when making changes.
Any recommendations?
[SOLVED]
Hi, I baked lighting with Bakery on a Windows PC (RTX). After moving the project to Mac, the lighting turns black. This happens with both the scene and the full project. How can I fix this?
This is Windows render:
This is how it looks on Mac pc:
Note 1: I saw this bug “everything looks black thing” in windows After baked lightmap, also after clicking Show Checker View everything seems black, when uncheck no problem. Probably Mac is stucks in this option.
Note 2: I made a lighting from scratch in a clean project and clean scene everything seems ok in Mac pc too. There is also Lighting Prefab script attached “saved”
[SOLUTION]
Work on clean things. In Mac project can not load lightmaps because Bakery Asset somehow not installed or removed etc. I don’t know i am sure i drag and dropped whole project. But i am wrong. No problem with just dragging lightmaps.scene and lightmaps folder. Peace out.
And Unity Mac Editor version is weird. After realizing oh bakery not installed let me install still black or lightmaps destroyed. Because Unity in Mac version deletes missing scripts. After reload scene attached bakery prefab script is seems gone.
I solved with first installed Bakery, after dragging and drop everything about scene and scene lightmaps folder. After that still need to bake again only reflection some probes “weirdo”
Hmm got the same issue on github today. Somehow I can’t repro this:
Does it happen in example_sponza_evening2 for you? Or only in your scene? Perhaps there are other ingredients that cause the bug?
Have you tried latest patches for both the lightmapper and the preview?
Oh interesting. The scene was stuck in Checker Preview mode? Did you close Unity while in this mode and then opened the project on Mac?
Opening the complete project with baked scenes on a Mac should technically work. At least these scripts need to be present.
Hello. I’ve been experiencing an issue with Bakery as of recent, and I know someone else has had the same problem. I’m using the latest GitHub patch on Unity 2021.3.16f1. When I attempt to bake with NVIDIA Driver 566.36 (the latest), Bakery quits as soon as it attempts to start rendering the lightmap.
Here’s a screenshot of the error it gives me:
Here’s my ftracelog.txt in a Pastebin (Unity Discussions won’t let me attach files) so it can hopefully help you diagnose the issue: pastes
I’m able to bake lighting (seemingly, I’m in the middle of a bake as of writing, which is farther than it ever got) when I revert my Bakery to the Asset Store version without any GitHub patch at all. UPDATE: The bake was successful. No issues at all.
Hopefully this helps fix the issue.
Got a couple of such reports about the github version recently, but no details. Very puzzling, as I can’t seem to repro it locally.
Quick questions:
- What is your GPU?
- Is RTX mode on/off?
- Does it happen on every scene (even examples)?
- If no, can it be related to the presence of light probes/volumes in the scene?
I have a NVIDIA GeForce RTX 3060.
RTX Mode is on.
I haven’t tested other scenes as of writing this. I only have one scene in my project other than the example scenes. If I were to bake the example scenes, I’d have to switch all the materials before doing so, then I can try those. UPDATE: After switching materials on the sponza_daytime example scene, I get a different error. I did NOT change any baking settings whatsoever, I only changed the materials of the meshes and assigned textures.
I’m unable to use Volumes due to modding constraints with the game I mod for. I do have light probes, more specifically Magic Light Probes.