Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

Discussion in 'Assets and Asset Store' started by guycalledfrank, Jun 14, 2018.

  1. jedeo1994

    jedeo1994

    Joined:
    Sep 24, 2012
    Posts:
    12
    Hey,
    Having some issues with changing the active scene.

    I baked two scenes "PleaseWork" and "PleaseWork2".
    "PleaseWork" was the active scene when I did the bake.
    Made sure to save both scenes after bake.

    Right after I finished baking, I could change the active scene between "PleaseWork" and "PleaseWork2" and the lightmaps looked fine. After I navigate away (An arbitrary scene) and load both scenes back in, only the first loaded scene can be active, otherwise all the lightmaps break.

    CleanLightmaps.PNG GarbageLightmaps.PNG

    Additional Info:
    Unity 2017.4.37
    Bakery 1.71
    No errors during baking
    Recently updated bakery

    Thanks so much for any insight you can provide. Really love bakery by the way. Keep up the great work.
     
    guycalledfrank likes this.
  2. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    How using a cubemap can be cheaper than using a 3d texture without mipmaps?
    Last time I checked. sampling a cubemap was actually quite expensive.
    Can you elaborate on that?
     
  3. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    It takes less memory place, is supported everywhere
     
  4. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    It can't take less space: you're only redistributing the same data differently (and less optimally, hence why it's slower)
    EDIT: well, actually you are storing way less information since each mipmap will be a quarter size, so it will be smaller, yes, but with much less info. I'm not sure how it would hold up.

    Also, 3D textures are supported since OpenGL ES 3.0 on mobile. If you're targeting less than that, using cubemaps will not cut it either, since it's way slower, so you'll have to stick to regular light probes for that.
    Honest question: do you think it is worth supporting OpenGL ES 2.0 devices nowadays? GLES 3.0 was released in 2012. It's been 8 years already. I'm not sure anyone using an 8 years old smartphone is interested in high-end graphics.
     
  5. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    I can't afford those fancy open gl 3 mobile phone, I only have a mali 400
     
  6. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Sorry, that sucks :(
    I would stick to regular light probes in your case.
    I stick myself to regular light probes for developing on Android: light volumes is expensive on old GPUs anyway.
     
  7. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    I can still experiment for fun tough, there is still teh old slice atlas with lerp across slice, but I would thought that mip access would be cheaper because more coherent access across close pixel on the same mip chain
     
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    After you change the unwrapping angle, and as each triangle becomes a separate UV island, they essentially become smaller, as each island needs some empty padding around. Your UV layout becomes more packed, with more tiny details - so it makes sense to increase resolution. Try setting Scale In Lightmap on the mesh renderer to e.g. 10.

    It looks like for some reason you have commas (",") instead of dots (".") in the pasted numbers. Replace these. There must be three comma-separated floats in each float3, i.e. float3(1.2, 3.4, 5.6)

    Only reasons I know:
    - Out of VRAM (very likely)
    - Out of RAM (less likely)
    - Editor is not in DX11 mode (unlikely, it would detect it earlier)

    First thing I would try is reducing resolution (texels per unit).

    Kinda looks like everything is just super bright. What are you light source settings? Can you show the lightmap textures?

    Invitations are automated: https://geom.io/bakery/wiki/index.php?title=Github_access

    Yeey!

    Ask @E-Cone

    Less lightmaps/larger lightmaps = less batches. How many do you have right now, and what is their resolution?

    I can confirm the warning/error messages, but reflection probes still appear to work correctly. How exactly does your scene "start to fail"?
    Unity does indeed warn about incompatible lighting data assets, but the part of it Bakery needs (reflection probes/light probes) seems to be compatible across most versions.
    You can avoid the warning by baking an empty scene to generate a new asset, then replacing my emptyLightingData.asset file with it. When you bake reflection probes, emptyLightingData.asset gets copied and then patched.

    Huh weird, I think I left the paths empty (default). Maybe I mixed up something with some example scenes in v1.71? What scene did you test? Anyway, after you click it to use default, it'll work as intended.

    https://geom.io/bakery/wiki/index.p...ng#Denoiser_throws_error_505_or_Unknown_error

    Did you try completely removing UV adjustments + reimporting models on destination machine? Also are you using identical Unity versions on both ends?

    Hmmm? Shell like fashion? I don't get it.

    Yeah, the solution is not new, using another (forth) volume texture with occlusion data. I can extend the tech to support it, but currently... it kinda looks pretty good even without it. Will think more about it.

    I remember fighting this error before. Was hoping it's gone. Related to incorrectly set directional mode for lightmaps.
    I've just added a fix to github (looks like it was caused by script initialization and OnSceneOpened callback being not in the order I expected) - can you check it?
     
  9. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Does anyone already has an Bakery Standard Shader (BuiltIn RP) with an integrated Volume evaluation?(shEvaluateDiffuseL1Geomerics())
     
  10. daibutsu

    daibutsu

    Joined:
    Nov 28, 2017
    Posts:
    42
    thanks for your reply.

    Now i have 400 batches. What do you think?
     
  11. kwt127

    kwt127

    Joined:
    Mar 8, 2015
    Posts:
    5
    Thank you for taking the time to respond to my question.

    I recall that when "LightingData.asset" was generated with an unusual name, the reflection probes were not well adapted when using it, but that's a bit fuzzy. I could be wrong.
    I thought this behavior was some kind of glitch, since it also warned me every time I loaded a scene.

    I'm going to try the countermeasures you've given me.
    Thank you for you’ve done.
     
    guycalledfrank likes this.
  12. Phazorknight

    Phazorknight

    Joined:
    Dec 31, 2014
    Posts:
    8
    Thanks for your continuing help with this. I've tried reducing texels before, it used to work but only at a very low number (20 texels). Unfortunately, I've now run into a new error: the bake now crashes even sooner during the "exporting objects" at 50%. Here's a screenshot:
    upload_2020-6-3_9-52-40.png


    Encountered this twice in a row.
    I was able to run a bake here and there at Texels set at 35 or 40, without changing my scene. What are some settings I can tweak to make sure it doesn't crash or optimize my scene?
     
  13. zisaMan

    zisaMan

    Joined:
    Jun 27, 2013
    Posts:
    25
    Hello,
    i have a couple of questions.
    Because i am working on a possible system to blend/swap lightmaps, could you please explain DYNAMICLIGHTMAP inside bakery standard shader?

    How can i access/assign new baked lightmaps? Are them assigned via property block?

    Thank you.

    P.S. I've succesfully submitted github request. :)
     
  14. w_adams

    w_adams

    Joined:
    Apr 7, 2016
    Posts:
    34
    Using Unity 2019.2.11f1, and Bakery 1.71, I have been unable to get the baked prefab workflow working. Am I doing something wrong here?

    My workflow:

    1: Drag prefab with Bakery Lightmapped Prefab script on root object into empty scene
    2: Verify that the prefab connection is OK
    3: Render via bakery
    4: Verify prefab now has bakeryprefablightmapdata on it
    5: Apply changes to prefab
    6: Drag new instance of prefab into scene
    7: Observe that the new prefab does not have baked lighting

    Thanks for any pointers.

    EDIT:

    I was able to isolate my problem to having a PhotonView on the prefab as well. The view IDs on the PhotonView keep changing, and it seems that the Bakery wasn't catching that in the validation error check. Or something, that's just a guess on my part. Moral of the story is that I was able to fix the issue by removing the photonview, baking, and then adding the photonview back.
     
    Last edited: Jun 8, 2020
    guycalledfrank likes this.
  15. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi. some RT Preview Feedback in

    Bakery v1.7.1
    Bakery Real-Time Preview v1.0
    add bakery-csharp GitHub, Jun 3
    add bakery-compiled Github, Jun 3

    The preview from example_shadowmask shows this green when baked with RTX mode.

    Preview_non_RTX_bake.JPG

    The preview from example_shadowmask works when baked without RTX mode.

    Preview_RTX_bake.JPG
    You can reproduce it by toggle RTX mode and a rebake. as often you want.)
     
  16. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    It's because you "peel layer of mipmap" from outer shell to inner part, they are mapped in concentric fashion.

    The simplest implementation imho is the spherical sampling:
    - take the vector from the cubemap center position toward the fragment
    - get the normal and the magnitude of that vector
    - use the normal to sample a direction and the magnitude to sample a mip map layer
    + potentially lerp between mip layer for smooth transition

    I hadn't thought of a proper cubic sampling, but each face of a 6faces cubemap is basically a pyramid of mipmap converging toward the center. While I personally use custom octahedron cubemap, the problem remain the same, how to sample carthesian coordinate easily into the pyramid, I don't know if it's easy, I just hadn't thought of it and nothing comes instantly .
    edit: it's probably like a frustrum, ie divide||multiply by magnitude.
    edit2: yeah it's project to the boundary of the primitive, then scale to mipmap by hashing magnitude, since we use center it scale homogeneously, the storage style of teh cubemap don't matter, what's matter is the shape of the primitive in how you compute the magnitude, the box magnitude is taking the major axis, then the projected magnitude on that axis (basically select the bigger component and use it's abs(value) to scale accordingly after normalizing it to mipmap range).
    To hash input value, you compute the mipmap selection level first, then hash to teh resolution of that mipmap.
     
    Last edited: Jun 4, 2020
    guycalledfrank likes this.
  17. lama89625

    lama89625

    Joined:
    Feb 14, 2019
    Posts:
    14
    Hi,

    I'm trying to use values that I've set in a MaterialPropertyBlock in a meta pass, but it looks like they are being ignored while baking. Is that how it's supposed to work?
    I do have a workaround in mind but it'd spare me some trouble to just make it work thru a property block.

    Thanks!
     
  18. jedeo1994

    jedeo1994

    Joined:
    Sep 24, 2012
    Posts:
    12
    Hey Frank,
    So I updated ftLightmaps.cs from your Github. The below image is what happens when if I have Directional Mode set to None.

    GarbageLightmapsAgain.PNG WarningMessage.PNG

    If I bake with Dominate Direction, it works fine (For this set of scenes) and I can swap the active scene around from something other than the first loaded scene.

    Thanks for you help! Let me know if you need anymore info.
     
  19. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    He is adamant it is new:
    https://twitter.com/reduzio/status/1268615438109270016
    Do you have reference about this?
    I want to see :D

    it's a great time for raytracing and GI anyway, the golden age is starting
     
  20. Tudor

    Tudor

    Joined:
    Sep 27, 2012
    Posts:
    150
    Hey, has anyone tried to integrate the bakery shader functionality for more advanced lightmap support (e.g. SH lightmaps) into other non-unity shaders, like the Uber shader for example? Just asking to gauge how much work that would be.
     
  21. ThatsComplicated

    ThatsComplicated

    Joined:
    Jun 3, 2019
    Posts:
    8
    Hi,
    Is it possible to swap beetwen 2 sets of scene lightmaps at runtime? For example from day lightmaps to night?
     
  22. Phazorknight

    Phazorknight

    Joined:
    Dec 31, 2014
    Posts:
    8
    Wanted to give an update on this: After a lot of trial and error, I found that if I removed some certain game objects, the baking process would not crash but proceeded again. But now the new result is super overexposed/blown out somehow. Everything is blindingly white and I have no idea what causes this as I have otherwise not changed my light baking settings.
    Here's a screenshot of the editor with an object selected so you can see how bright it is:

    upload_2020-6-9_9-54-3.png

    In comparison this is roughly what it should look like:
    upload_2020-6-9_9-55-22.png
     
  23. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I have an interieur scene where the sun shines in and casts shadows from the windows frames, facade openings onto the floor.
    Now I placed a vertical plane outside of the room close to the facade and defined it as a lightmesh.
    To get nice results from this lightmesh I am forced to enable "Cast shadows" in the Meshrenderer component of this object.
    But then the sun gets blocked and I don´t have shadows on the floor anymore:
    (I also placed the lightmesh GameObject on a layer that is ignored by the sunlight but it doesn´t change anything.)

    upload_2020-6-10_10-59-46.png

    A solution seems to be to uncheck "Self shadow" in the BakeryLightMesh component, but this results in very inaccurate sampling, see ceiling for details:

    upload_2020-6-10_13-34-42.png

    So my question is, how can I preserve the mesh from blocking the sun while still giving accurate light sampling as in first image?
     
    Last edited: Jun 10, 2020
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Not catastrophic (unless running on a mobile with very slow CPU).
    The number is relative to scene complexity. I can't say if it's low or high, because I don't know what is drawn with these numbers and what is your target hardware.

    This is not a very low number, unless you're baking interiors.

    The only reason I know is still RAM-related.
    What's your scene size vs texels per unit vs RAM (and VRAM) size?

    It's a leftover from standard shader (Bakery shader is standard shader with some modifications). DYNAMICLIGHTMAP refers to Enlighten lighting.

    Engine-supported maps are set directly by the engine.
    Color: unity_Lightmap
    Shadowmask: unity_ShadowMask
    Dominant direction: unity_LightmapInd
    Any non-Bakery shader that deals with lightmaps, can use them.

    Non-standard maps (RNM and SH) are set via MaterialPropertyBlack (named _RNM0, _RNM1, _RNM2).
    Bakery.cginc contains methods to read RNM and SH (BakeryRNM(), BakerySH()).
    Per-vertex lightmaps are assigned via additionalVertexStreams.

    Should be already applied after the bake is finished.

    Weird, it should work. I don't know what PhotonView is and what it is doing. When you click render, there should be a window saying "these prefabs will be overwritten" or "NOT overwritten". First means everything is baked correctly, second might mean that your changing ID is the problem.
    On the bakeryprefablightmapdata there is a button to show data. Check if "maps" and "bakedRenderers" fields are filled and not empty. That would mean that prefab is baked correctly. Other possibility is that PhotonView is modifying renderers somehow when you instantiate it.

    Hmmm weird, I could not reproduce this bug:

    upload_2020-6-11_11-18-1.png

    It looks like as if you had a second directional light.

    By "rebake" do you mean re-opening preview?

    What is your GPU? Mine is 1060 (non-RTX), maybe that's why it works differently (but I doubt...). Can you check if this green light disappear if you change other lights? Does it bake to lightmaps as well?

    Ahh. I get it now! Interesting, clever, I never thought about it. I like that you can use hardware interpolation to sample it. But:
    - There will be disproportionately low slice count comparing to width/depth, but it might be OK given we often need only a handful of probes above walkable area and large horizontal resolution.
    - Cubemaps also can't have non-square faces, if I'm not mistaken, this may lead to stretching if you really just wanted a long corridor.
    - Gaps between mips may be too large. Second mip only covers 1/4 of the first mip area. I think there will be too much missed data between them.

    Bakery renders meta pass via DrawMeshNow, and it only uses the material.
    I've just added some code to use MaterialPropertyBlocks, you can download patches from github.
    I didn't test it extensively yet, so it's disabled by default, but you can turn it on by adding

    #define SUPPORT_MBLOCKS


    as the first line in ftUVGBufferGen.cs. Tell me if it works.

    Argh. Are you combining multiple scenes, one using directional, other non-directional lightmaps? Is it just a single non-directional scene? o_O

    Dunno. I'm just saying baking tiny shadowmaps for probes is not new, maybe his particular solution is new.
    E.g. https://casual-effects.com/research/McGuire2017LightField/McGuire2017LightField.pdf
    There was more, but I can't recall names of other papers...

    Yes, with some scripting. Maybe check this: https://geom.io/bakery/wiki/index.p...ions#Lightmap_Swapper_.26_Light_Probe_Storage

    Maybe some objects you removed opened a hole to some super bright light that was previously blocked? RTPreview is helpful to diagnoze these things.

    Currently you can't. Best option here is to use Skylight instead of a light mesh. Were there any problems with it? Windows are large enough to get good sampling of the sky.
     
  25. Object-Null

    Object-Null

    Joined:
    Feb 13, 2014
    Posts:
    70
    Hello there,

    i got a issue with rendering lightprobes
    when i try to bake the lightprobes. alot of times im getting this message:

    Scene geometry/layout changed since last full bake.
    Use Render Button instead.

    But I did not changed anything between render the laightmap and render lightprobes.
    i have no clue why im getting this warning.

    any ideas here?


    edit:
    this is the error i get after trying to bake the lightprobes


    ValidateScaleOffsetImmutability: scale/offset does not match
    UnityEngine.Debug:LogError(Object)
    ftBuildGraphics:ValidateScaleOffsetImmutability(ExportSceneData) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:2862)
    ftBuildGraphics:PackAtlases(ExportSceneData) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4188)
    <ExportScene>d__199:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4691)
    <RenderLightmapFunc>d__252:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4324)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3743)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()


     
    Last edited: Jun 12, 2020
  26. Object-Null

    Object-Null

    Joined:
    Feb 13, 2014
    Posts:
    70
    @joz_nascimento
    Are you still having problems with you greens and yellow bakes when baking?

    Had had the same problem. But only the green part. It figured out it was triggered bij small object with a green colour an bakerymbakery lighter script attached. I don't know why. But that was the issue for me to get my whole scene green.

    Maybe you also have some green/yellow mesh lights in your scene that interfere with your baking

    Not sure if this info is need but well. Maybe it helps someone else who got the same problem
     
  27. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Pure useless geekery below, discard if apply

    Only if you assume we use hw accelerated 6 faces cubemap, you can do a custom cubemap like octahedron or latlong map, it still has mip to be sample, this mean you are free to pack the data size you want.

    But I'm going to reveal the real geekery here:
    the original idea wasn't to sample mips, I was documenting myself on light field and they are light represented as probe at each point basically, they call this the plenoptic function which has 5 dimensional (ie has a position and directional data, like xyz phi theta) but in the talk they explain that a 5d lightfield (understand a 3d grid of point sample) could be compressed down to 4d (xy and angles) and still reconstruct the full 5d. Impressive stuff has been shown, like there is a bush obscuring a street, and using the light field equation, they could reconstruct the street (with a lot of clarity) behind by simply adjusting the virtual focus on it. Which how light field camera work, they are a 2d array of probe.

    A cubemap being a 2d array at the boundary of a convex space, I assume we had enough data to reconstruct the light field inside the empty space, which would compress the memory requirement, but you would need more than one sample per query (I haven't experimented with it yet so I don't get the procedure right now). It would be slower than a 3d grid (which is like a single query) but save memory and potentially have more precision if you use the save memory to increase the resolution (which would be quadratic instead of cubic). Sampling mips is just a fall back idea I had because it's way simpler and already had the idea of using cubemap.

    I also wanted to explore what it mean for real time lighting (since the plenoptic function give us ray almost for free, assuming we find a real time representation), which is why I'm developing my current GI solution now, i'm half way through the most basic proof of concept, I just need to inject real time shadow map, which should have been given, but unity's implementation isn't friendly to baking, so now I have to reimplement a whole shadow pipeline and that mean refactoring my code and reimplementing other unity's function (the custom render texture is crap). I'm still in built in, but it's obvious I'm basically redoing a whole pipeline by now, converting to srp I hope will be easy ... My solution is already a kind of lightfield solution, I'm basically doing per pixel probe cache.

    Yeah I know and HE knows too :D his solution started by implementing the ddgi of mc guire, but he find out a new format, it's not a depth texture apparently, but a visibility propagation 3d array, as per this 2d example
    https://twitter.com/reduzio/status/1264270099390894081
    I have no idea how it's been used, he promised an article down the line.
    I thought you had a paper that show a 3d array used for visibility sampling too (ie not just a 2d depth map probe)

    If anyone have any idea.

    edit:
    okay I guess each array represent how much a probe is visible at a single occlusion space, so we sample the visibility mask and weight the probe accordingly in the interpolation
    so something like lerp(probe1*visibility, probe2*visibility, distance ratio)
     
    Last edited: Jun 11, 2020
    guycalledfrank likes this.
  28. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    102
    @guycalledfrank Hi, I always have some problems with legacy probes, perhaps the best thing would be not to consider them, but now that they are calculated much faster it was not bad to have them working, in the test scene sponza everything is fine, in my test scene instead they are not uniform and more they are not saved in the scene, unity 2019.4f1 and updated bakery from github repository. Sorry if I'm repetitive
     
  29. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I use legacy lightprobes all the time and work flawless for me.
    Can you share that test scene with us so we can test it?
     
    guycalledfrank likes this.
  30. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    102
    Hi, I have deleted the folder where Bakery saves LightingData and now the probes are uniform, but they are not saved, I am attaching the scene
     

    Attached Files:

  31. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    You might be having file permission issues.
    Try running the Unity editor as an administrator and check the scene again.
     
  32. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    102
    Hi, if I open UnityEditor as an administrator, Unity Hub opens and then gives me an error, how do I start it as an administrator?

    Edit: I also put hub to run as administrator, (I had tried it before but I had not restarted the hub) now the project opens as administrator but still does not save me the probes ..

    Edit2: The rendering of probes with non-uniform colors gives it to me when I use shadowmask not in full lighting and with the other L1 and unity methods the probes are saved
     
    Last edited: Jun 15, 2020
  33. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    102
    Hi everyone, is there anyone who confirms to me that in unity 2019.4.0f1 Bakery Render Mode: shadowmask, Light Probe Mode: Legacy, Occlusion probes, does not save the probes in play mode and the color of probes are not uniform?
     
  34. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Do that lightmap count limiter god damn it :D
     
  35. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    guycalledfrank likes this.
  36. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Hey, I am experiencing some bug, sometimes area lights does not have any effect. To fix this I have to recreate area light with same settings, then it usually works. Do you know what could be the reason? I have no errors in baking.
     
  37. longshotsg

    longshotsg

    Joined:
    Dec 8, 2014
    Posts:
    11
    Hi Frank,

    Thought of asking my question here as well.
    I'm creating lightmapped prefabs with each prefab in their individual scenes and only a skylight and no shadows.
    Just a simple brighter looking model. None directional light mapping.

    Anyway I have 3 variants of a model of different material. U can think of it as 3 human with different skin colors but same base model.

    The problem comes when i put in these prefabs and run in play mode in another scene lit by SH lightmapping.
    Variant 1 is ok. Variant 2 and 3 has these black bands around the model.
    They only appear in play mode. Looks ok in the scene.

    I tried disabling denoise and also don't change on UV asset processing but they are the same.
    The bands disappeared only when i changed to unlit/bakery light shader.
    This works for now because my lightmapped prefabs are super simple.

    Any permanent or better solutions for this?

    Thanks.
    Jason
     
  38. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Try updating from github, I definitely fixed something related.

    Wow. Do you remember what object that was? Any info would help to fix it.

    Then there is no benefit comparing to just 3D texture unpacked to 2D atlas (?)

    The idea is interesting, but probably not worth the hassle at the moment, at least not as a basic light probe replacement. The precision is questionable, worlds are very non-convex and can have many weird closed occluders not being visible from every convex point, sampling is heavy and simple 3D color volumes are not that big, especially if you place many of them where you need them and not just cover the whole world in one, but this technique would also require accurate placement.

    Actually sounds very intriguing for real-time GI. Looking forward for your results.

    Ah... hmmm. Yeah this is something new then. I remember Crytek LPPV paper mentioned something similar (tracing occluders while propagating), but they actually shipped without this feature (just bounced without occlusion).

    2019.4 is not yet tested/supported... as well as Legacy light probes. L1 mode should be very fast to bake. I'll test your scene though - thanks for sending it.

    Atlasing logic is already so complicated I'm afraid to complicate it further. Also it's not possible to know in advance how many atlases you'll need if we still respect texels per unit. If you want everything to be packed in a particular amount of atlases, use lightmap groups (one group = one lightmap).

    If you bake with "combine with Enlighten" checkbox, it will be enabled.

    Weird! Not sure how is that possible. Are you sure there are no differences in settings at all? If you encounter it again, please send me the scene for debugging (just leave the light, other objects are not needed).

    Any screenshots? Did you just override a few properties on the model without duplicating/modifying/doing anything else with the prefab? It should work actually.
     
    neoshaman and Graham-B like this.
  39. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    The problem is, I am not using Bakery in every scene in my project. Some scenes are using Realtime Global Illumination with no baking whatsoever.

    It looks like I was able to fix these scenes however, by setting "combine with Enlighten" checkbox to true, and then saving these settings as default in the bakery menu.
     
    guycalledfrank likes this.
  40. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    I figured that when "Self shadow" is enabled it will works as should, however, I always replace standard mesh plane to a cube and scale it up to suit my scenes. I am assuming that Bakery light source is from within this cube or close to the border of mesh surface? Hence, it will not cast any light as it becomes "trapped" inside this mesh light emitter object. I tested this in small test scene, but I will do a big overnight bake on a huge scene and see what are the new results. Thanks.

    Overnight bake of the scene worked, it took 14 hours. Disabling Self shadow fixed my problem.


     

    Attached Files:

    Last edited: Jun 24, 2020
  41. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    yo, clear baked data keeps deleting scene lightmapping setings!! fix this please, its been there form day 1 its very annoying.
     
    Monil and atomicjoe like this.
  42. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    Using Version 1.71 (the latest version as of 6/25/2020) Bakery freezes apparently infinitely in ftBuildGraphics.cs on the line
    xatlas.xatlasPack(atlas, attempts, packTexelsPerUnit, packResolution, maxChartSize, padding, bruteForce);//, allowRotate);

    I reduced "const int attempts = 4096;" to "const int attempts = 8;" to try to see if that would help but it did not.

    I base that it froze infinitely after letting Unity run for 4 hours and not seeing any difference from "Exporting scene - preparing..." and in Task Manager the Unity editor takes 2.5% of CPU without change, and 9,059.9 MB of memory without change. If Unity was actually working I would expect one of these two values to change. In addition, Editor.log (attached) did not change over the course of the 20 minutes I had looked for the file to refresh.

    Prior to attempting the build, I deleted all logs out of E:\Work\EmpireOfEmber\Client\Assets\Editor\x64\Bakery from other scenes and after attempting the build there were still no logs in that directory. It had not gotten far enough to create logs?

    The last modification time to Editor.log was only a few minutes after I started the build, meaning the 4 hours I let Unity run overnight apparently did not output any further logs.

    Other scenes in my project work, it is one complex scene in particular that has this issue.

    I am able to lightmap this scene using Unity's build-in system using CPU mode, provided I use the lowest possible settings. Higher settings crash the editor.

    I've attached the editor log, a screenshot of Visual Studio prior to the freeze, and a screenshot of my Bakery settings.

    I'm able to reach "xatlas.xatlasPack(...)" in 1 minute 30 seconds, and a breakpoint after that line is never reached.

    If Occlusion probes is checked Unity just freezes on "Waiting for Unity to initialize the probes"

    upload_2020-6-25_3-11-41.png

    upload_2020-6-25_3-12-0.png

    upload_2020-6-25_3-24-23.png
     

    Attached Files:

  43. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    I'm trying to get light transmission to work with bakery but I can't figure out how. Here's an example:

    Annotation 2020-06-25 121333.jpg
    Since I changed my trees to contribute GI the areas underneath became very dark. I've seen in some games where the baked lighting goes through the trees and casts a green hue underneath, is this possible with Bakery?

    Something like this:
    shot_2020.06.25__time_12_23_n01.png
     
  44. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    I need to bake shadows in a room cast on walls/floor by various furniture and objects inside that room. So that all interior objects are used only as shadow/ambient "casters" to contribute and bake their shadows/ambient occlusion on room walls/floor, but all those interior objects are not included in baked maps and don't have second UVs.

    As far as I know this is impossible with any Unity lightmappers. Because objects can be either static and then all of them are included into lightmaps, or they are not static, and then their shadows are ignored completely.

    Is it possible with Bakery?
     
  45. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    You can do that both on Unity builtin lightmapper and Bakery by setting the lightmap size in the object renderer you want to cast shadows to zero and contribute to GI. This way that object will NOT be baked but will cast shadows and ambient occlusion on other baked objects.
     
    guycalledfrank and Ukounu like this.
  46. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115

    Hi there!

    I've been having this weird issue: tiny black dots all over some of my walls.

    I have tried increasing the sample count and the texels per unit, to no success. How can I further improve this?
     
  47. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    Thanks, I didn't know that.
     
  48. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I do that all the time for things like speedtrees.
    This way you can then set the trees to be lit by lightprobes and still cast shadows over the rest of the lightmapped geometry.
     
    Ukounu likes this.
  49. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    I believe the OP is asking for translucency on the leafs. I think this was discused back in the forum with some ivy leafs. ITs from when the realistic house. I'll try to find
     
  50. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814