Bakery - GPU Lightmapper (v1.98) + RTPreview [RELEASED]

Hello,

i did an fast test and converted the new Unity Standard scene to reasonable parameters. Standard exposure workflow. It was all cranked up per default.

The Bakery RT preview looks nice. This is an absolut game changer and speeds up the setup by factors.

i set intensity 100 to the DefaultHDRISky for the BakerySkyLight.

and the Bakery Direct Light to 10

to get this nice Bakery RT preview.
I also added Bakery Point light to the SpotLights per multiselection.

What I get after indirect Bake with L1 probes with these parameters are these Lightmaps and Probes. Nice.
But the Game view looks like this.

I have to add an Indirect Lighting Controller (Screenshot left side)
and set it to 200.
Then it looks great.

Do i do something wrong here?
Why i must set the indirect lighting to 200?
I was happy that i found it but i thinks i should be possible without.

I am on latest Bakery Github Repro and HDRP 10.1.0 in Unity 2020.2.0b8.

2 Likes

btw the lightmaps looks like this

Hi, I’ve a desert scene, I would like to bake just the terrain, at least for now.

When hit bake it tells me that its going to bake 115 lightmaps which sseems like its going to be too much so I cancel.

I lowered the terrain’s lightmap scale but I keep getting the same number.

How coul dI just render the terrain, while still receiving indirect from other objects (without setting other objects lightmap scale to 0), like “just bake this selected object” ¿?.

“Render selected groups” having terrain selected seems not to help.

tx

edit I create da group with the terrain, lowered a lot the texels per unit and it crasehd but I may retry at some other point.

some more shots to explain my problem with the indirect light controler crank up to 200 from

Bakery - GPU Lightmapper (v1.96) + RTPreview [RELEASED] page-95#post-6453390

outputs
Unity PLM (left) vs Bakery (right)

note the Lighting Exposure Corrections in Scene Window and on Lightmap Preview
-9.7 PLM (without i see pure white on every outout)
-0.6 Bakery

Bake setting also in the window.

I only corrected Directional Light and DefaultIBL to reasoinable parameters for Bakery bake.

Note: PLM does not bake LOD from rocks and plants.

I really cannot get why the Standard PLM setup works wit these strange exposure values and i must why set exposure to -10 to get an preview output. Also the exposure corrections in the post volumes are needed with complete strange values.
For Bakery i correctet to Physical camera values and expoure settings around 0.

Anyone an idea?

1 Like

Is ist possible to use the HDRP SH nodes with a vector 3 instead of a texture? I’m trying to use the normal from the Virtual Texturing stack to produce sh lightmaps and would like to reuse the sampled data instead of having a duplicate normal map just for this purpose.

Hi, first time using Bakery. My current project has a realtime daylight system. Would it possible to use bakery only to bake ambient occlusion on static objects and scenery and still be able to change the scene ambient color and get dynamic sun shadows and lighting?

FYI and a question.

I tested the vegetation engine and it s an great set of amplify shaders who can run nearly any vegetation assets from the store after conversion with wind and advanced seasons on BuiltIn, URP and HDRP.

Test Scene from video for download available in video description

and what comes next…

Because it is so versatile I would to know if you baked these voxel trees with your new Light Probe 3D textures (irradiance volumes).

and if yes when it would be possible to generate an amplify function the easy way for these vegetation engine amplify shaders?

1 Like

@keeponshading Hi there. Thanks for the email. I was actually looking at how good Book of the Dead looks with occlusion probes and one week later I get this :slight_smile:
I would be interested in adding support, it that’s a possibility. It would really help to bring all the lighting together.
I’m still busy with the next update, but I’ll get in touch with the dev in the following days :wink:

2 Likes

Hey. I did this Occlusion Probe Test with your old set of Amplify Shaders some while ago.
https://discussions.unity.com/t/701793 page-3#post-4716548
Therefore i used the Bakery Occlusion Probe trigger in the UI.

But the experimental Light Probe 3D textures (irradiance volumes)
from Mr F have so much potential.
https://discussions.unity.com/t/704890 page-88#post-5880422
I did some early tests who really rock.

At the end of this post you can find the Shader (testSHVolumes.shader)
https://discussions.unity.com/t/704890 page-88#post-5900201

Let s see what Mr. F says to it.
First i really wanted to know if the Combining multiple trees with lighting baked to voxels demo uses these Light Probe 3D textures (irradiance volumes)?

FYI
Another older topic.
Bake LOD vegetation geo the normal way.

I sent Mr F these Assets this setup of Book of the Dead Assets a while ago.6457945--723919--upload_2019-12-16_15-34-53.jpg

The rocks and vegetation all have LOD´s and he managed to bake and pack the lightmaps really dense after some investigation.
So Bakery can also bake this LOD vegetation stuff now really fast and pack it all together.

One 4K map can hold several trees and lots of square meters gras now.
There was a post on discoord after he solved it but i cannot find it anymore.

So left Unitys Progressive.
Right Bakery. Rocks and Vegetation has LOD and are baked nicely now.
I tested this it yesterday.

6454655--723212--B04.JPG

6453390--722928--id200.JPG

Last but not least there is this great Bakery Community Extension who allows bake to vertex and instancing.

Vertex Lightmap To Mesh Asset
(by Mr F)

Download

Vertex color baking uses additionalVertexStreams to bind an additional vertex buffer to the graphics pipeline without breaking the link with the original mesh asset; but additionalVertexStreams cannot be batched/instanced.

This tool adds “Bakery/Utilities/New mesh asset with vertex color” menu option that’ll generate a new complete mesh asset out of every selected GameObject having MeshRenderer/MeshFilter. These can be then used with batching.

New assets are saved to Assets/VCMesh folder.

https://geom.io/bakery/wiki/index.php?title=Community_extensions

2 Likes

sweet, is it more costly than lightprobes?
i benched LPPV on switch and these are way costlier, I guess it’s the same 3d texture lookup, just wanted to check.

1 Like

I just bought it, when it works it’s fantastic. Far superior stability, quality and speed to GPU progressive.
I have a few questions and I’m running into problems with one scene

  • on one scene RT preview won’t start, no error code. it shows the
  • one light, the sky light should have no shadow, how do i set up the Bakery Direct Light component for that?
  • when RT works, the geometry is very angular as if normal smoothness wasn’t taken into account
  • reflection probe is not automatically refreshed on baking so each time I forget to press the button and it looks off, i don’t see what benefit there is in not automatizing this so I think it should be automatic.
  • bakery light mesh should function with emission map of URP materials, currently it’s complaining that the material should be unlit. emission is unlit.
  • show checker shows non static objects
  • the asset folders are in the root, i read that they can be moved elsewhere, will update from the package manager displace those or will it understand by the meta files that these are the same files and the new location?
  • bakery lightmaps are stored in a new folder that’s in the root: very inconvenient as it pollutes the root of project. Instead it should be stored in the scene folder where builtin lightmaps and navmesh and occlusions are stored.
  • i tried to delete the bakery folders to re install clean and error happens

RT previs not working:
6460840--724492--bakery rt no wanna.gif
mesh light:


show checker:

some times RT casts this error:
6460840--724501--upload_2020-10-26_23-10-0.png
error on delete Editor folder:
6460840--724504--upload_2020-10-26_23-11-40.png

1 Like

and after i deleted the editor folder from the file browser of windows and then reinstalled bakery I’m getting this error (i’m not importing the examples)

and baking a scene that used to work is stuck there
6460891--724516--upload_2020-10-26_23-37-50.png
could be related


that windows cannot be canceled so i need to exit unity :frowning:
after restart it worked on one scene then broke again on another
it left an etron on the console, hope this helps
6460891--724522--upload_2020-10-27_0-3-13.png
note: I use 2020.1.10

Not sure if it’s possible or not - Lightmapped Prefabs only store lightmap-related data. Reflection probes are managed completely by the engine and I don’t know if engine allows dynamically creating/moving them. Basically if it works without Bakery, it’ll work with it.

Hmm is it Unity 5.6? Lighting data asset patching for shadowmasked point lights in 5.6 may be a bit flaky - even on 2017 you shouldn’t have this problem. I gave up fixing this, as Unity doesn’t want to disclose the format or provide any API for it, and newer version have ways to avoid it.

No idea then. These arrays must have data. The data is set during the bake (you can see "probes.bakedProbes = " in ftRenderLightmap.cs) and then stored forever in the lighting data asset associated with the scene:

6461971--724696--upload_2020-10-27_15-29-51.png

Maybe LightmapSettings.lightProbes.count returns something weird? Have you tried bakedProbes.Length? Maybe you’re calling this code when the asset is not yet set?

It shouldn’t be. Any more details about your lights’ setup?

Not sure I understand your concern. To me it looks like the cubemap is rotated the way I’d expect it to:

https://www.youtube.com/watch?v=3eMkRyqib4o

Doesn’t it work the same in your scene? If it doesn’t, maybe try updating from github.

Add ambient light?
Tried Skylight?

I didn’t work with MeshBaker, but apparently it just overlayed all subobjects’ UVs on top of each other. It needs to re-pack lightmap UVs after mesh combining. Check if there is any option for that (I’m pretty sure it must have some).

Was fixed, please update from github

Delete them :smile:

They should work. In case you get light leaking through walls onto dynamic objects, make sure to also enable “occlusion probes” checkbox. These approximate shadows from realtime lights on top of “regular” light probes only storing indirect illumination.

  1. Install from the store.
  2. Follow the instructions to patch it with github files on top: https://geom.io/bakery/wiki/index.php?title=Github_access
1 Like

Nice scene! I think I missed when it was released. What is the shader used on the leaves? :smile:

Did you touch the exposure in RTPreview, or was it set to 1?
Then the lightmap must have similar intensity to what you saw there. Possibly you have postprocessing exposure darkening the image too much. How does it look without any post-processing?

Can get better if you enable hole filling :slight_smile:

Terrain’s scale in lightmap is respected. Possibly you just didn’t decrease it enough; it could be assigned massive resolution (which is then just clamped by Max Resolution) by texels per unit. You can try some ridiculous values like 0.0001 to make a noticeable difference.

Setting other objects’ scale in lightmap to 0 is the only option for now.

Currently terrains cannot be a part of a lightmap group.

… but I probably forgot to add a check for it…

If you have a world-space normal, you can replace this bit with your own input:

6462055--724753--upload_2020-10-27_16-40-42.png

Bake ambient occlusion: yes.
Dynamic sun: yes.
Dynamic ambient color: you’ll need to write a shader that would multiply lightmap AO by this color. Maybe there is an easier way, but it’s a first thing that comes to my mind…

Grass is PRETTY!

I did.
Originally I was using per-vertex baking for the trees, but eventually it became too much data. Probe volumes are more sparse, but still give enough precision; additionally the same volume is used to light all dynamic objects.
And all your LOD levels can read lighting from the same volume.

Who knows? I’m not an expert in Amplify.
But sampling these volumes is pretty easy in the shader, so I guess it shouldn’t be too hard to integrate it to Amplify as well.

BTW, with latest github patches you can also get shadowmasks in a separate 3D texture, meaning you can replace Unity’s regular occlusion probes with them.
You can find them in GetComponent().bakedMask.
They provide decent shadow approximation for distant objects:

6462223--724774--upload_2020-10-27_16-52-18.png

6462223--724777--upload_2020-10-27_16-52-47.png

Reading multiple volume textures is certainly more expensive than using single per-object value. It can be noticeable on mobile, but no so much on PC/consoles. The cost is proportional to the amount of pixels executing this shader - so if your dynamic objects don’t have huge screen area, it may still be viable.
Also AFAIK Unity’s LPPV uses full floating point textures (?), while Bakery uses half-floats.
Another difference is: Bakery volumes are never updated in runtime. They are static assets. LPPV is refreshed dynamically when an object moves if I understood it correctly.
The best answer is to test :slight_smile:

Is there any message in the bottom of .ftracelog.txt after it happens? If it mentions something about probes, please try updating from github (specifically bakery-rtpreview-csharp repository), or, as a quick workaround, set light probe mode to Legacy.

Skylight always has a shadow. But for direct light you can disable it by setting shadow samples to 0 (mentioned in the docs).

It uses your geometry normals directly, but it doesn’t use your normal maps (unless in Baked Normal Maps mode). Are you sure it’s the normals being “angular” and not low resolution UV seams?

Maybe. Originally I separated it because it’s essentially a non-Bakery function; probes are rendered by the engine itself. But from the UX perspective you are right - I’ll try to tidy it up.

These complaints are more for self-validation, to make sure your emission color and your lighting match each other. Ignoring these complaints is okay if you know they match. Unlit shaders are just a safe bet because they never mix anything extra into the only value they display; for example, if your material has white albedo AND bright emission, then it may actually be brighter than the emissive color alone, as albedo, illuminated by the lights, will add to combined emission.

I know, but I didn’t find the way to avoid it (apart from setting a constant on every dynamic object, which I wanted to avoid for performance). Usually it’s not a big problem, as you can recognize irrelevant (dynamic) objects and don’t pay attention to them.

Yes, folders can be moved, but I’m not sure if Unity package importing will respect it and not try to import a second copy to Assets…

Tried this? https://geom.io/bakery/wiki/index.php?title=Manual#Use_scene_named_output_path

Caused by forcing Unity to render reflection probes via internal method - can be safely ignored though.

Restart Unity. It locks DLL files on first use and these cannot be deleted until restart.

6462223--724789--upload_2020-10-27_17-18-18.png

Apparently you didn’t delete everything. Otherwise you wouldn’t get errors from a Bakery shader…

Update from github?
(Related fix: https://github.com/guycalledfrank/bakery-csharp/commit/5bb66c9415cf848cef0a6fb3d603fedf01721139)

1 Like

No it’s tangent space, but already sampled, think of it as a normal that I already processed, and would normally connect to the master node, but instead I want to pass it through your node. Can I just replace the sampling process in your subgraph with the normal directly, or will this break something ?

Right. Then you’ll need to replace the PerPixelWorldNormal subgraph. There is nothing fancy, it just transforms the normal from tangent to world, so just… try replacing “Sample Texture 2D” with your own input?

It makes sense having a vector as input as default option - I’ll probably make it this way in future releases!

Hello!

Is it possible to bake lighting into a whole timeline sequence? I have a movie to be played in the Oculus Quest, and I the lighting will always be the same in the whole scene. Is there any way I can bake all the lighting into all the moving objects?

Thanks!

If objects move, but lighting doesn’t change, it should be possible. If you mark objects to “Contribute GI” but don’t set other static flags, they should still be movable.